home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 3 / ct-rom iiib.zip / ct-rom iiib / WINDOWS / UTILITY / SCHIJF / FC_20C / WILDOC.MA_ < prev    next >
Text File  |  1992-08-12  |  477KB  |  17,159 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                                      WIL Reference Manual
  7.  
  8.  
  9.          ________________________________________________________________
  10.  
  11.                      Copyright (c) 1988-1992 by Morrie Wilson.
  12.                                 All rights reserved.
  13.  
  14.  
  15.  
  16.  
  17.         No part of this manual may be reproduced or transmitted in any
  18.         form or by any means, electronic or mechanical, including
  19.         photocopying and recording, for any purpose without the express
  20.         written permission of Wilson WindowWare, Inc.  Information in
  21.         this document is subject to change without notice and does not
  22.         represent a commitment by Wilson WindowWare, Inc.
  23.  
  24.  
  25.  
  26.         The software described herein is furnished under a license
  27.         agreement.  It is against the law to copy this software under any
  28.         circumstances except as provided by the license agreement.
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.         U.S. Government Restricted Rights
  42.         Use, duplication, or disclosure by the Government is subject to
  43.         restrictions as set forth in subdivision (b)(3)(ii) of the Rights
  44.         in Technical Data and Computer Software clause at 252.227-7013.
  45.         Contractor/manufacturer is Wilson WindowWare, Inc. / 2701
  46.         California Ave SW #212 / Seattle, WA 98116 / Orders: 800-762-8383
  47.         / Support: 206-937-9335 / Fax: 206-935-7129.
  48.  
  49.  
  50.  
  51.  
  52.         Trademarks
  53.         Microsoft and MS-DOS are registered trademarks of Microsoft
  54.         Corporation.
  55.         Windows, Word for Windows, and Excel are trademarks of Microsoft
  56.         Corporation.
  57.  
  58.         WinEdit is a trademark of Wilson WindowWare, Inc.
  59.  
  60.  
  61.  
  62.  
  63.          ________________________________________________________________
  64.                                                                        ii
  65.  
  66.                                                                  CONTENTS
  67.          ________________________________________________________________
  68.  
  69.  
  70.                                       CONTENTS
  71.  
  72.  
  73.         CONTENTS                                       iii
  74.  
  75.         INTRODUCTION                                     1
  76.            About This Manual                             1
  77.            Notational Conventions                        2
  78.            Acknowledgements                              3
  79.  
  80.         MENU FILES                                       5
  81.            About Menu Files                              5
  82.            Menu File Structure                           5
  83.            Modifying Menus                               8
  84.            Menu Hotkeys                                  8
  85.  
  86.         WIL TUTORIAL                                    10
  87.            WIL Basics                                   10
  88.              What is a WIL Program?                     10
  89.              Our First WIL Program                      11
  90.              Functions and Parameters                   11
  91.              Displaying Text                            13
  92.              Getting Input                              14
  93.              Using Variables                            16
  94.              Making Decisions                           16
  95.              Branching                                  18
  96.            Exploring WIL                                20
  97.              Running Programs                           20
  98.              Display and Input                          21
  99.              Manipulating Windows                       24
  100.              Files and Directories                      28
  101.              Handling Errors                            30
  102.              Selection Menus                            32
  103.              Nicer File Selection                       35
  104.              Nicer Messages                             36
  105.              Running DOS Programs                       38
  106.              Sending Keystrokes to Programs             39
  107.              Our Completed WIL File                     40
  108.  
  109.         THINGS TO KNOW                                  43
  110.              Recovering from Cancel                     43
  111.              Aborting WIL processing                    43
  112.              Default program for unknown extension      43
  113.              Partial window names                       44
  114.              Sounds                                     44
  115.  
  116.         WIL LANGUAGE                                    45
  117.            Menu Structure {*M}                          45
  118.            Menu Items {*M}                              45
  119.            Language Components                          46
  120.  
  121.          ________________________________________________________________
  122.                                                                       iii
  123.  
  124.                                                                  CONTENTS
  125.          ________________________________________________________________
  126.  
  127.              Constants                                  46
  128.              Identifiers                                48
  129.              Variables                                  48
  130.              Lists                                      48
  131.              Keywords                                   49
  132.              Operators                                  49
  133.              Precedence and evaluation order            50
  134.              Comments                                   50
  135.              Statements                                 51
  136.              Substitution                               51
  137.            Function Parameters                          52
  138.            Error Handling                               53
  139.            The Functions & Statements                   54
  140.              Inputting Information                      54
  141.              Displaying Information                     54
  142.              File Management                            55
  143.              Directory Management                       56
  144.              Disk Drive Management                      57
  145.              Window Management                          57
  146.              Program Management                         59
  147.              String Handling                            59
  148.              Arithmetic Functions                       61
  149.              Clipboard Handling                         61
  150.              Process Control                            61
  151.              Miscellaneous Functions                    63
  152.              System Information                         63
  153.              DDE Functions                              64
  154.              Network Functions                          65
  155.              Multimedia Functions                       66
  156.              Menu Management                            66
  157.  
  158.         WIL FUNCTION REFERENCE                          67
  159.            WIL Introduction                             67
  160.            Abs                                          68
  161.            AppExist                                     69
  162.            AppWaitClose                                 70
  163.            AskLine                                      71
  164.            AskPassword                                  73
  165.            AskYesNo                                     74
  166.            Average                                      75
  167.            Beep                                         76
  168.            ButtonNames                                  77
  169.            Call                                         78
  170.            Char2Num                                     80
  171.            ClipAppend                                   81
  172.            ClipGet                                      82
  173.            ClipPut                                      83
  174.            CurrentFile {*M}                             84
  175.            DateTime                                     85
  176.            DDEExecute                                   87
  177.            DDEInitiate                                  88
  178.  
  179.          ________________________________________________________________
  180.                                                                        iv
  181.  
  182.                                                                  CONTENTS
  183.          ________________________________________________________________
  184.  
  185.            DDEPoke                                      89
  186.            DDERequest                                   90
  187.            DDETerminate                                 91
  188.            DDETimeout                                   92
  189.            Debug                                        93
  190.            Delay                                        96
  191.            Dialog                                       97
  192.            DialogBox                                   102
  193.            DirChange                                   104
  194.            DirGet                                      105
  195.            DirHome                                     106
  196.            DirItemize                                  107
  197.            DirMake                                     108
  198.            DirRemove                                   109
  199.            DirRename                                   110
  200.            DirWindows                                  111
  201.            DiskFree                                    112
  202.            DiskScan                                    113
  203.            Display                                     114
  204.            DOSVersion                                  115
  205.            Drop                                        116
  206.            Else                                        117
  207.            EndSession                                  118
  208.            Environment                                 119
  209.            ErrorMode                                   120
  210.            Exclusive                                   121
  211.            Execute                                     122
  212.            Exit                                        123
  213.            FileAppend                                  124
  214.            FileAttrGet                                 125
  215.            FileAttrSet                                 126
  216.            FileClose                                   127
  217.            FileCopy                                    128
  218.            FileDelete                                  129
  219.            FileExist                                   130
  220.            FileExtension                               131
  221.            FileItemize                                 132
  222.            FileLocate                                  133
  223.            FileMove                                    134
  224.            FileOpen                                    135
  225.            FilePath                                    136
  226.            FileRead                                    137
  227.            FileRename                                  138
  228.            FileRoot                                    139
  229.            FileSize                                    140
  230.            FileTimeGet                                 141
  231.            FileTimeTouch                               142
  232.            FileWrite                                   143
  233.            Goto                                        144
  234.            IconArrange                                 145
  235.            If...Then                                   146
  236.  
  237.          ________________________________________________________________
  238.                                                                         v
  239.  
  240.                                                                  CONTENTS
  241.          ________________________________________________________________
  242.  
  243.            IgnoreInput                                 147
  244.            IniDelete                                   148
  245.            IniDeletePvt                                149
  246.            IniItemize                                  150
  247.            IniItemizePvt                               151
  248.            IniRead                                     152
  249.            IniReadPvt                                  153
  250.            IniWrite                                    154
  251.            IniWritePvt                                 155
  252.            IntControl                                  156
  253.            IsDefined                                   159
  254.            IsKeyDown                                   160
  255.            IsLicensed                                  161
  256.            IsMenuChecked {*M}                          162
  257.            IsMenuEnabled {*M}                          163
  258.            IsNumber                                    164
  259.            ItemCount                                   165
  260.            ItemExtract                                 166
  261.            ItemInsert                                  167
  262.            ItemLocate                                  168
  263.            ItemRemove                                  169
  264.            ItemSelect                                  170
  265.            ItemSort                                    172
  266.            LastError                                   173
  267.            LogDisk                                     174
  268.            Max                                         175
  269.            MenuChange {*M}                             176
  270.            Message                                     177
  271.            Min                                         178
  272.            MouseInfo                                   179
  273.            NetAddCon                                   181
  274.            NetAttach                                   182
  275.            NetBrowse                                   183
  276.            NetCancelCon                                184
  277.            NetDetach                                   185
  278.            NetDialog                                   186
  279.            NetGetCaps                                  187
  280.            NetGetCon                                   189
  281.            NetGetUser                                  190
  282.            NetLogin                                    191
  283.            NetLogout                                   192
  284.            NetMapRoot                                  193
  285.            NetMemberGet                                194
  286.            NetMemberSet                                195
  287.            NetMsgAll                                   196
  288.            NetMsgSend                                  197
  289.            Num2Char                                    198
  290.            ParseData                                   199
  291.            Pause                                       200
  292.            PlayMedia                                   201
  293.            PlayMidi                                    203
  294.  
  295.          ________________________________________________________________
  296.                                                                        vi
  297.  
  298.                                                                  CONTENTS
  299.          ________________________________________________________________
  300.  
  301.            PlayWaveForm                                204
  302.            Random                                      206
  303.            Reload {*M}                                 207
  304.            Return                                      208
  305.            Run                                         209
  306.            RunHide                                     210
  307.            RunHideWait                                 211
  308.            RunIcon                                     212
  309.            RunIconWait                                 213
  310.            RunWait                                     214
  311.            RunZoom                                     215
  312.            RunZoomWait                                 216
  313.            SendKey                                     217
  314.            SKDebug                                     220
  315.            SnapShot                                    221
  316.            Sounds                                      222
  317.            StrCat                                      223
  318.            StrCmp                                      224
  319.            StrFill                                     225
  320.            StrFix                                      226
  321.            StriCmp                                     227
  322.            StrIndex                                    228
  323.            StrLen                                      229
  324.            StrLower                                    230
  325.            StrReplace                                  231
  326.            StrScan                                     232
  327.            StrSub                                      233
  328.            StrTrim                                     234
  329.            StrUpper                                    235
  330.            Terminate                                   236
  331.            TextBox                                     237
  332.            TextBoxSort                                 239
  333.            TextSelect                                  240
  334.            Then                                        241
  335.            Version                                     242
  336.            VersionDLL                                  243
  337.            WaitForKey                                  244
  338.            WallPaper                                   245
  339.            WinActivate                                 246
  340.            WinArrange                                  247
  341.            WinClose                                    248
  342.            WinCloseNot                                 249
  343.            WinConfig                                   250
  344.            WinExeName                                  251
  345.            WinExist                                    252
  346.            WinGetActive                                253
  347.            WinHelp                                     254
  348.            WinHide                                     256
  349.            WinIconize                                  257
  350.            WinItemize                                  258
  351.            WinMetrics                                  259
  352.  
  353.          ________________________________________________________________
  354.                                                                       vii
  355.  
  356.  
  357.          ________________________________________________________________
  358.  
  359.            WinName                                     261
  360.            WinParmGet                                  262
  361.            WinParmSet                                  264
  362.            WinPlace                                    265
  363.            WinPlaceGet                                 267
  364.            WinPlaceSet                                 268
  365.            WinPosition                                 270
  366.            WinResources                                271
  367.            WinShow                                     272
  368.            WinState                                    273
  369.            WinTitle                                    274
  370.            WinVersion                                  275
  371.            WinWaitClose                                276
  372.            WinZoom                                     277
  373.            Yield                                       278
  374.  
  375.         APPENDIX A  Predefined Constants               279
  376.  
  377.         APPENDIX B  Errors                             281
  378.            Minor Errors                                281
  379.            Moderate Errors                             282
  380.            Fatal Errors                                283
  381.  
  382.         APPENDIX C  Browser                            286
  383.  
  384.         INDEX                                          287
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.          ________________________________________________________________
  412.                                                                      viii
  413.  
  414.                                                              INTRODUCTION
  415.          ________________________________________________________________
  416.  
  417.  
  418.                                     INTRODUCTION
  419.  
  420.         WIL (Windows Interface Language) is a powerful, yet easy-to-learn,
  421.         procedural language, which provides a rich set of functions to
  422.         Windows users.  It can:
  423.  
  424.  
  425.            .  Run Windows and DOS programs.
  426.  
  427.            .  Send keystrokes directly to Windows applications.
  428.  
  429.            .  Rearrange, resize, hide, and close windows.
  430.  
  431.            .  Run programs either concurrently or sequentially.
  432.  
  433.            .  Display information to the user in various formats.
  434.  
  435.            .  Prompt the user for any needed input.
  436.  
  437.            .  Present scrollable file and directory lists.
  438.  
  439.            .  Copy, move, delete, and rename files.
  440.  
  441.            .  Read and write files directly.
  442.  
  443.            .  Copy text to and from the Clipboard.
  444.  
  445.            .  Perform string and arithmetic operations.
  446.  
  447.            .  Make branching decisions based upon numerous factors.
  448.  
  449.  
  450.         And much, much more.
  451.  
  452.  
  453.  
  454.  
  455.         About This Manual
  456.         WIL is not a stand-alone product.  Rather, it is a language
  457.         interpreter which can be integrated into many different types of
  458.         Windows applications.  This manual is a function reference for the
  459.         WIL language itself, as well as a guide to creating basic WIL
  460.         programs.  Because WIL can be implemented in many different ways,
  461.         this manual must at times be somewhat general.  Therefore, you will
  462.         need to refer to your application's User's Guide for information on
  463.         any additional functions which may be available, as well as
  464.         functions which may be unavailable or which may operate differently
  465.         than presented here.  In all cases, your product-specific
  466.         documentation supersedes the information provided in this Reference
  467.         Manual.
  468.  
  469.          ________________________________________________________________
  470.                                                                         1
  471.  
  472.                                                              INTRODUCTION
  473.          ________________________________________________________________
  474.  
  475.         WIL can be implemented in two basic "flavors": menu and batch.  In
  476.         a menu system, WIL commands are defined in one or more menu files,
  477.         each of which can contain many different tasks, or menu items.  In
  478.         a batch system, each task is contained in a separate batch file.
  479.         In this manual, we will use the term WIL program to refer to both
  480.         an individual menu item and to a batch file, each of which performs
  481.         an individual task (which can, in turn, consist of many different
  482.         commands).  We will use the term WIL Interpreter to refer to that
  483.         part of your application which is responsible for executing WIL
  484.         programs.
  485.  
  486.         The symbol {*M} will be used to indicate a function or a section of
  487.         the manual which applies only to menu-based implementations of the
  488.         WIL Interpreter.
  489.  
  490.  
  491.  
  492.  
  493.         Notational Conventions
  494.         NOTE: Not used in disk-based version of the manual.  These
  495.         conventions apply to the printed version only.
  496.  
  497.  
  498.  
  499.         Throughout this manual, we use the following conventions to
  500.         distinguish elements of text:
  501.  
  502.         ALL-CAPS
  503.            Used for filenames.
  504.  
  505.         Boldface
  506.            Used for important points, programs, function names, and parts
  507.            of syntax that must appear as shown.
  508.  
  509.         system
  510.            Used for items in menus and dialogs, as they appear to the user.
  511.  
  512.         Small fixed-width
  513.            Used for WIL sample code.
  514.  
  515.         Italics
  516.            Used for emphasis, and to liven up the documentation just a bit.
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.          ________________________________________________________________
  528.                                                                         2
  529.  
  530.                                                              INTRODUCTION
  531.          ________________________________________________________________
  532.  
  533.         Acknowledgements
  534.  
  535.  
  536.         WIL software developed by Morrie Wilson.
  537.  
  538.         Documentation written by Richard Merit.
  539.  
  540.         Development funded by registered users.
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.          ________________________________________________________________
  586.                                                                         3
  587.  
  588.                                                                MENU FILES
  589.          ________________________________________________________________
  590.  
  591.  
  592.                                      MENU FILES
  593.  
  594.  
  595.  
  596.  
  597.         About Menu Files
  598.         This section of the manual shows how to create WIL menu files.  It
  599.         is presented here so that you will be able to follow along with the
  600.         tutorial material which follows.  It is not important at this point
  601.         to understand the actual commands which are shown in the menus.
  602.  
  603.           If you are using a batch file-based implementation of WIL, you
  604.           can skip this section and move on to the WIL Tutorial (pg. 10).
  605.  
  606.  
  607.  
  608.  
  609.         Menu File Structure
  610.         WIL menus are defined in standard ASCII text files (the kind
  611.         created by Notepad).  See your product documentation for the name
  612.         of the default menu file that it uses.
  613.  
  614.         Every menu file contains one or more menu items which appear in
  615.         drop-down menus.  They may also contain top-level menu names which
  616.         show up in a main menu bar (refer to your product documentation for
  617.         more information).  Each menu item consists of a title which
  618.         identifies the item, followed by one or more lines of menu code
  619.         which the WIL Interpreter will execute when you choose the item.
  620.  
  621.         Your application probably included a pre-defined sample menu, and
  622.         you should refer to it as a practical example of correct menu
  623.         structure.  Here is an extremely simple menu file:
  624.  
  625.          &Games
  626.           &Solitaire
  627.             Run("sol.exe", "")
  628.  
  629.  
  630.         The first line, &Games, begins in column 1, and therefore defines a
  631.         top-level menu item.  Depending on the product you are using, it
  632.         may either appear on a menu bar or it may appear on the first-level
  633.         drop-down menu.  The ampersand (&) is optional; it defines an Alt-
  634.         key combination for the entry (Alt-G in this example).  It will
  635.         appear in the menu as Games. {Imagine the G underlined.}
  636.  
  637.         The second line, &Solitaire, begins in column 2, and defines the
  638.         title for an individual menu item.  Again, the ampersand (&) is
  639.         optional, and defines an Alt-key combination of Alt-S.  This item
  640.         will appear in the menu as Solitaire.
  641.  
  642.  
  643.          ________________________________________________________________
  644.                                                                         5
  645.  
  646.                                                                MENU FILES
  647.          ________________________________________________________________
  648.  
  649.         The third line, Run("sol.exe", ""), is the actual code which will
  650.         be executed when this menu item is selected.  Like all menu code,
  651.         it must be indented at least four spaces (i.e., it must begin in
  652.         column 5 or higher).  This third line is really the entire WIL
  653.         program; the two lines above it are simply titles which define the
  654.         position of the program (i.e., the menu item) in the overall menu
  655.         structure.
  656.  
  657.         Here's a slightly expanded version of the program:
  658.  
  659.          &Games
  660.           &Solitaire
  661.             Display(1, "Game Time", "About to play Solitaire")
  662.             Run("sol.exe", "")
  663.  
  664.  
  665.         Here, we've simply added a line of code, changing this into a two-
  666.         line program.  Notice that each additional line of code is still
  667.         indented the same four spaces.
  668.  
  669.         Now, let's look at a menu file which contains two menu items:
  670.  
  671.          &Games
  672.           &Solitaire
  673.             Run("sol.exe", "")
  674.           &Minesweeper
  675.             Run("winmine.exe", "")
  676.  
  677.  
  678.         We've added a new menu item, Minesweeper, which begins in column 2
  679.         (like Solitaire) and will appear under the top-level menu item
  680.         Games (like Solitaire).
  681.  
  682.         To add a new top-level menu item, just create a new entry beginning
  683.         in column 1:
  684.  
  685.         &Games
  686.          &Solitaire
  687.              Run("sol.exe", "")
  688.          &Minesweeper
  689.              Run("winmine.exe", "")
  690.  
  691.         &Applications
  692.          &Notepad
  693.              Run("notepad.exe", "")
  694.          &WinEdit
  695.              Run("winedit.exe", "")
  696.  
  697.  
  698.  
  699.  
  700.  
  701.          ________________________________________________________________
  702.                                                                         6
  703.  
  704.                                                                MENU FILES
  705.          ________________________________________________________________
  706.  
  707.         Now there are two top-level menu titles, Games and Applications,
  708.         each of which contains two individual items (the blank line between
  709.         Games and Applications is not necessary, but is there just for
  710.         readability).
  711.  
  712.         In addition to top-level menus, you can optionally define one or
  713.         two levels of submenus.  The titles for the first-level and second-
  714.         level submenus must begin in columns 2, and 3, respectively, and
  715.         the individual menu items they contain must be indented one
  716.         additional column.  For example:
  717.  
  718.         &Applications
  719.          &Editors
  720.           &Notepad
  721.              Run("notepad.exe", "")
  722.           &WinEdit
  723.              Run("winedit.exe", "")
  724.  
  725.          &Excel
  726.              Run("excel.exe", "")
  727.  
  728.  
  729.  
  730.         In the above example, Editors is a submenu (which begins in column
  731.         2), which contains two menu items (which begin in column 3).  Excel
  732.         also begins in column 2, but since it does not have any submenus
  733.         defined below it, it is a bottom-level (i.e., individual) menu
  734.         item.  Here's an even more complex example:
  735.  
  736.         &Applications
  737.          &Editors
  738.           &Notepad
  739.              Run("notepad.exe", "")
  740.           &WinEdit
  741.              Run("winedit.exe", "")
  742.  
  743.          |&Spreadsheets
  744.           &Windows-based
  745.            &Excel
  746.              Run("excel.exe", "")
  747.  
  748.           _&DOS-based
  749.            &Quattro
  750.              Run("q.exe", "")
  751.  
  752.  
  753.  
  754.         We've added an additional level of submenus under Spreadsheets, so
  755.         that the bottom-level menu items (Excel and Quattro) now begin in
  756.         column 4.  There are also two special symbols presented in this
  757.         menu: the underscore (_), which causes a horizontal separator line
  758.  
  759.          ________________________________________________________________
  760.                                                                         7
  761.  
  762.                                                                MENU FILES
  763.          ________________________________________________________________
  764.  
  765.         to be drawn above the associated menu title, and the vertical bar
  766.         (|), which causes the associated menu title to appear in a new
  767.         column.
  768.  
  769.         It is possible to place an individual (bottom-level) menu item in
  770.         column 1:
  771.  
  772.         &Notepad
  773.              Run("notepad.exe", "")
  774.  
  775.  
  776.  
  777.         in which case it will appear on the top-level menu, but will be
  778.         executed immediately upon being selected (i.e., there will be no
  779.         drop-down menu).
  780.  
  781.  
  782.  
  783.  
  784.         Modifying Menus
  785.         As stated earlier, menu files must be created and edited with an
  786.         editor, such as Notepad, that is capable of saving files in pure
  787.         ASCII text format.  After you have edited your menu, it must be
  788.         reloaded into memory for the changes to take effect.  You may be
  789.         able to do this manually, via the application's control menu (see
  790.         your product documentation for information).  Or, you can have a
  791.         menu item use the Reload function.  Otherwise, the menus will be
  792.         reloaded automatically the next time you execute any menu item.
  793.         However, if the menus are reloaded automatically, the WIL
  794.         Interpreter will not be able to determine which menu item you had
  795.         just selected, and it will therefore display a message telling you
  796.         that you need to re-select it.
  797.  
  798.  
  799.  
  800.  
  801.         Menu Hotkeys
  802.         In addition to the standard methods for executing a menu item
  803.         (double-clicking on it, highlighting it and pressing Enter, or
  804.         using Alt + the underlined letter), you may be able to define
  805.         optional hotkeys for your menu items (depending on the
  806.         implementation of WIL in the product you are using), which will
  807.         cause an item to be executed immediately upon pressing the
  808.         designated hot key.  Hotkeys are defined by following the menu item
  809.         with a backslash (\) and then the hotkey:
  810.  
  811.         &Accessories
  812.          &Notepad  \  {F2}
  813.              Run("notepad.exe", "")
  814.          &Calculator  \  ^C
  815.              Run("calc.exe", "")
  816.  
  817.          ________________________________________________________________
  818.                                                                         8
  819.  
  820.  
  821.          ________________________________________________________________
  822.  
  823.  
  824.  
  825.         In the above example, the F2 key is defined as the hotkey for
  826.         Notepad, and Ctrl-C is defined as the hotkey for Calculator.
  827.  
  828.         Most single keys and key combinations may be used as hotkeys,
  829.         except for the F10 key, and except for Alt and Alt-Shift key
  830.         combinations (although you may use Alt-Ctrl key combinations).
  831.         Refer to the SendKey function (pg. 216) for a list of special
  832.         keycodes which may also be used as hot keys.
  833.  
  834.         If you always access a menu item by using its hotkey, you may not
  835.         need or want the menu item to appear in the pull-down menus.  If
  836.         so, you can make it a non-displayed menu item by placing a @ symbol
  837.         in front of the title.  For example:
  838.  
  839.         &Accessories
  840.          @Notepad  \  {F2}
  841.              Run("notepad.exe", "")
  842.  
  843.  
  844.         In this case, Notepad would not appear in the pull-down menus, but
  845.         could still be accessed by using the F2 hotkey.
  846.  
  847.         Note:  Hotkeys and non-displayed menu items may not work in all
  848.         implementations of the WIL Interpreter.
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.          ________________________________________________________________
  876.                                                                         9
  877.  
  878.                                                              WIL TUTORIAL
  879.          ________________________________________________________________
  880.  
  881.  
  882.                                     WIL TUTORIAL
  883.  
  884.  
  885.  
  886.  
  887.         WIL Basics
  888.  
  889.  
  890.  
  891.         What is a WIL Program?
  892.         A WIL program, like a DOS batch file, is simply a list of commands
  893.         for the computer to process.  Any task which will be run more than
  894.         once, or which requires entering multiple commands or even a single
  895.         complex command, is a good candidate for automation as a WIL
  896.         program.  For example, suppose you regularly enter the following
  897.         commands to start Windows:
  898.  
  899.         First:
  900.  
  901.          cd\windows
  902.  
  903.         then:
  904.  
  905.          win
  906.  
  907.         and then:
  908.  
  909.          cd\
  910.  
  911.         Here, you are changing to the Windows directory, running Windows,
  912.         and then returning to the root directory.  Instead of having to
  913.         type these three commands every time you run Windows, you can
  914.         create a DOS batch file, called WI.BAT, which contains those exact
  915.         same commands:
  916.  
  917.          cd\windows
  918.          win
  919.          cd\
  920.  
  921.         Now, to start Windows, you merely need to type the single command
  922.         WI, which runs the WI.BAT batch file, which executes your three
  923.         commands.
  924.  
  925.         WIL programs work basically the same way.
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.          ________________________________________________________________
  934.                                                                        10
  935.  
  936.                                                              WIL TUTORIAL
  937.          ________________________________________________________________
  938.  
  939.  
  940.  
  941.  
  942.         Our First WIL Program
  943.         Our first WIL program will simply run our favorite Windows
  944.         application: Solitaire.  If you are using a menu script-based
  945.         implementation of the WIL Interpreter, refer to the preceding
  946.         section on Menu Files (pg. 5) for instructions on how to create and
  947.         edit WIL menu items.  If you are using a batch file-based
  948.         implementation of the WIL Interpreter, you will be creating your
  949.         batch files using an editor, such as Notepad, that is capable of
  950.         saving text in pure ASCII format.  In either case, let's create a
  951.         WIL program containing the following line of text:
  952.  
  953.          Run("sol.exe", "")
  954.  
  955.         Save the program, and run it (refer to your product documentation
  956.         for information on how to execute a WIL program).  Presto!  It's
  957.         Solitaire.
  958.  
  959.  
  960.  
  961.  
  962.         Functions and Parameters
  963.         Now, let's look more closely at the line we entered:
  964.  
  965.          Run("sol.exe", "")
  966.  
  967.         The first part, Run, is a WIL function.  As you might have guessed,
  968.         its purpose is to run a Windows program.  There are a large number
  969.         of functions and commands in WIL, and each has a certain syntax
  970.         which must be used.  The correct syntax for all WIL functions may
  971.         be found in the WIL Function Reference (pg. 67).  The entry for Run
  972.         starts off as follows:
  973.  
  974.  
  975.         Syntax:
  976.          Run (program-name, parameters)
  977.  
  978.         Parameters:
  979.          (s) program-name = the name of the desired .EXE, .COM, .PIF, .BAT
  980.                       file, or a data file.
  981.          (s) parameters =   optional parameters as required by the
  982.                       application.
  983.  
  984.  
  985.         Like all WIL functions, Run is followed by a number of parameters,
  986.         enclosed in parentheses.  Parameters are simply additional pieces
  987.         of information which are provided when a particular function is
  988.         used; they may be either required or optional.  Optional parameters
  989.         are indicated by being enclosed in square brackets.  In this case,
  990.  
  991.          ________________________________________________________________
  992.                                                                        11
  993.  
  994.                                                              WIL TUTORIAL
  995.          ________________________________________________________________
  996.  
  997.         Run has two required parameters: the name of the program to run,
  998.         and the parameters to be passed to the program.
  999.  
  1000.         WIL functions use several types of parameters.  Multiple parameters
  1001.         are separated by commas.  In the example
  1002.  
  1003.          Run("sol.exe", "")
  1004.  
  1005.         "sol.exe" and "" are both string constants.  String constants can
  1006.         be identified by the quote marks which delimit (surround) them.
  1007.         You may use either double ("), single forward (') or single back
  1008.         (`) quote marks as string delimiters; the examples in this manual
  1009.         will use double quotes.
  1010.  
  1011.         Note:  In our shorthand method for indicating syntax the (s) in
  1012.         front of a parameter indicates that it is a string parameter.
  1013.  
  1014.         You may have noticed how we said earlier that the two parameters
  1015.         for the Run function are required, and yet the entry for Run in the
  1016.         WIL Function Reference describes the second parameter "parameters"
  1017.         as being optional.  Well then, which one is correct?  Well, from
  1018.         a language standpoint, the second parameter is required.  That is,
  1019.         if you omit it, you will get a syntax error, and your WIL program
  1020.         will not run properly.  However, the program that you are running
  1021.         may not need any parameters.  Solitaire, for example, does not take
  1022.         any parameters.  The way we handle this in our programs is to
  1023.         specify a null string  --- two quote marks with nothing in between
  1024.         --- as the second parameter, as we have done in our example above.
  1025.  
  1026.         To illustrate this further, let's create a WIL program containing
  1027.         the following line:
  1028.  
  1029.          Run("notepad.exe", "")
  1030.  
  1031.         This is just like our previous file, with only the name of the
  1032.         program having been changed.  Save the file, and run it.  You
  1033.         should now be in Notepad.  Now, edit the WIL program as follows:
  1034.  
  1035.          Run("notepad.exe", "c:\autoexec.bat")
  1036.  
  1037.         Save the program, exit Notepad, and run the WIL program again.  You
  1038.         should now be in Notepad, with AUTOEXEC.BAT loaded.  As we've just
  1039.         demonstrated, Notepad is an example of a program which can be run
  1040.         with or without a file name parameter passed to it by WIL.
  1041.  
  1042.         It can often be helpful to add descriptive text to your WIL
  1043.         programs:
  1044.  
  1045.          ; This is an example of the Run function in WIL
  1046.          Run("notepad.exe", "c:\autoexec.bat")
  1047.  
  1048.  
  1049.          ________________________________________________________________
  1050.                                                                        12
  1051.  
  1052.                                                              WIL TUTORIAL
  1053.          ________________________________________________________________
  1054.  
  1055.         The semicolon at the beginning of the first line signifies a
  1056.         comment, and causes that line to be ignored.  You can place comment
  1057.         lines, and/or blank lines anywhere in your WIL programs.  In
  1058.         addition, you can place a comment on the same line as a WIL
  1059.         statement by preceding the comment with a semicolon.  For example:
  1060.  
  1061.          Run("sol.exe", "")   ; this is a very useful function
  1062.  
  1063.         Everything to the right of a semicolon is ignored.  However, if a
  1064.         semicolon appears in a string delimited by quotes, it is treated as
  1065.         part of the string.
  1066.  
  1067.  
  1068.  
  1069.  
  1070.         Displaying Text
  1071.         Now, let's modify our original WIL program as follows:
  1072.  
  1073.          ; solitare.program
  1074.          Display(5, "Good Luck!", "Remember ... it's only a game.")
  1075.          Run("sol.exe", "")
  1076.  
  1077.         And run it.  Notice the message box which pops up on the screen
  1078.         with words of encouragement:
  1079.  
  1080.                ....................................
  1081.                .            Good Luck!            .
  1082.                ....................................
  1083.                .                                  .
  1084.                .  Remember ... it's only a game.  .
  1085.                .                                  .
  1086.                ....................................
  1087.  
  1088.         That's done by the Display function in the second line above.
  1089.         Here's the reference for Display:
  1090.  
  1091.  
  1092.         Syntax:
  1093.          Display (seconds, title, text)
  1094.  
  1095.         Parameters:
  1096.          (i) seconds =  Seconds to display the message (1-3600).
  1097.          (s) title   =  Title of the window to be displayed.
  1098.          (s) text    =  Text of the window to be displayed.
  1099.  
  1100.  
  1101.         Note that the Display function has three parameters.  The first
  1102.         parameter  --- in our example, 5 --- tells the number of seconds
  1103.         which the display box will remain on the screen (you can make the
  1104.         box disappear before then by pressing any key or mouse button).
  1105.         This is a numeric constant, and  --- unlike string constants ---
  1106.  
  1107.          ________________________________________________________________
  1108.                                                                        13
  1109.  
  1110.                                                              WIL TUTORIAL
  1111.          ________________________________________________________________
  1112.  
  1113.         it does not need to be enclosed in quotes (although it can be, if
  1114.         you wish, as WIL will automatically try to convert string variables
  1115.         to numeric variables when necessary, and vice versa).  The second
  1116.         parameter is the title of the message box, and the third parameter
  1117.         is the actual text displayed in the box.
  1118.  
  1119.         Note:  In our shorthand method for indicating syntax the (i) in
  1120.         front of a parameter indicates that it is a string parameter.
  1121.  
  1122.         Now, exit Solitaire (if you haven't done so already), and edit the
  1123.         WIL program by placing a semicolon at the beginning of the line
  1124.         with the Run function.  This is a handy way to disable, or "comment
  1125.         out," lines in your WIL programs when you want to modify and test
  1126.         only certain segments.  Your WIL program should look like this:
  1127.  
  1128.          ; solitare.program
  1129.          Display(5, "Good Luck!", "Remember ... it's only a game.")
  1130.          ; Run("sol.exe", "")
  1131.  
  1132.         Now, experiment with modifying the parameters in the Display
  1133.         function.  Try adjusting the value of the first parameter.  If you
  1134.         look up Display in the WIL reference section, you will see that the
  1135.         acceptable values for this parameter are 1-3600.  If you use a
  1136.         value outside this range, WIL will adjust it to "make it fit"; that
  1137.         is, it will treat numbers less than 1 as if they were 1, and
  1138.         numbers greater than 3600 as 3600.  Also, try using a non-integer
  1139.         value, such as 2.5, and see what happens (you should receive an
  1140.         error message).  Play around with the text in the two string
  1141.         parameters; try making one, or both, null strings ("").
  1142.  
  1143.  
  1144.  
  1145.  
  1146.         Getting Input
  1147.         Now, let's look at ways of getting input from a user and making
  1148.         decisions based on that input.  The most basic form of input is a
  1149.         simple Yes/No response, and, indeed, there is a WIL function called
  1150.         AskYesNo:
  1151.  
  1152.  
  1153.         Syntax:
  1154.          AskYesNo (title, question)
  1155.  
  1156.         Parameters
  1157.          (s) title    =     title of the question box.
  1158.          (s) question =     question to be put to the user.
  1159.  
  1160.         Returns:
  1161.          (i)          @YES or @NO, depending on the button pressed.
  1162.  
  1163.  
  1164.  
  1165.          ________________________________________________________________
  1166.                                                                        14
  1167.  
  1168.                                                              WIL TUTORIAL
  1169.          ________________________________________________________________
  1170.  
  1171.         You should be familiar with the standard syntax format by now; it
  1172.         shows us that AskYesNo has two required parameters.  The Parameters
  1173.         section tells us that these parameters both take strings, and tells
  1174.         us what each of the parameters means.
  1175.  
  1176.         You will notice that there is also a new section here, called
  1177.         Returns.  This section shows you the possible values that may be
  1178.         returned by this function.  All functions return values.  We
  1179.         weren't concerned with the values returned by the Run and Display
  1180.         functions.  But with AskYesNo, the returned value is very
  1181.         important, because we will need that information to decide how to
  1182.         proceed.  We see that AskYesNo returns an integer value.  An
  1183.         integer is a whole (non-fractional) number, such as 0, 1, or 2 (the
  1184.         number 1.5 is not an integer).  We also see that the integer value
  1185.         returned by AskYesNo is either @YES or @NO.  @YES and @NO are
  1186.         predefined constants in WIL.  All predefined constants begin with
  1187.         an @ symbol, and we will distinguish them further by typing them in
  1188.         all caps.  You will find a list of all predefined constants in
  1189.         Appendix A (pg. 278).  Even though the words Yes and No are
  1190.         strings, it is important to remember that the predefined constants
  1191.         @YES and @NO are not string variables.  (Actually, @YES is equal to
  1192.         1, and @NO is equal to 0.  Don't worry if this is confusing; you
  1193.         really don't need to remember or even understand it.)
  1194.  
  1195.         Now, let's modify our WIL program as follows:
  1196.  
  1197.          AskYesNo("Really?", "Play Solitaire now?")
  1198.          Run("sol.exe", "")
  1199.  
  1200.         and run it.  You should have gotten a nice dialog box which asked
  1201.         if you wanted to play Solitaire:
  1202.  
  1203.  
  1204.              .....................................
  1205.              .             Really?               .
  1206.              .....................................
  1207.              .                                   .
  1208.              .       Play Solitaire now?         .
  1209.              .                                   .
  1210.              .     [Yes]    [No]    [Cancel]     .
  1211.              .....................................
  1212.  
  1213.  
  1214.  
  1215.         but no matter what you answered, it started Solitaire anyway.  This
  1216.         is not very useful.  We need a way to use the Yes/No response to
  1217.         determine further processing.  First, we need to explore the
  1218.         concept and use of variables.
  1219.  
  1220.  
  1221.  
  1222.  
  1223.          ________________________________________________________________
  1224.                                                                        15
  1225.  
  1226.                                                              WIL TUTORIAL
  1227.          ________________________________________________________________
  1228.  
  1229.  
  1230.  
  1231.  
  1232.         Using Variables
  1233.         A variable is simply a placeholder for a value.  The value that the
  1234.         variable stands for can be either a text string (string variable)
  1235.         or a number (numeric variable).  You may remember from Algebra 101
  1236.         that if X=3, then X+X=6.  X is simply a numeric variable, which
  1237.         stands here for the number 3.  If we change the value of X to 4
  1238.         (X=4), then the expression X+X is now equal to 8.
  1239.  
  1240.         Okay.  We know that the AskYesNo function returns a value of either
  1241.         @YES or @NO.  What we need to do is create a variable to store the
  1242.         value that AskYesNo returns, so that we can use it later on in our
  1243.         WIL program.  First, we need to give this variable a name.  In WIL,
  1244.         variable names must begin with a letter, may contain any
  1245.         combination of letters or numbers, and may be from 1 to 30
  1246.         characters long.  So, let's use a variable called response.  (We
  1247.         will distinguish variable names in this text by printing them in
  1248.         all lowercase letters; we will print function and command names
  1249.         starting with a capital letter.  However, in WIL, the case is not
  1250.         significant, so you can use all lowercase, or all uppercase, or
  1251.         whatever combination you prefer.)  We assign the value returned by
  1252.         AskYesNo to the variable response, as follows:
  1253.  
  1254.          response = AskYesNo("Really?", "Play Solitaire now?")
  1255.  
  1256.         Notice the syntax.  The way that WIL processes this line is to
  1257.         first evaluate the result of the AskYesNo function.  The function
  1258.         returns a value of either @YES or @NO.  Then, WIL assigns this
  1259.         returned value to response.  Therefore, response is now equal to
  1260.         either @YES or @NO, depending on what the user enters.
  1261.  
  1262.         Now, we need a way to make a decision based upon this variable.
  1263.  
  1264.  
  1265.  
  1266.  
  1267.         Making Decisions
  1268.         WIL provides a way to conditionally execute a statement, and that
  1269.         is by using the If ... Then command.  Actually, there are two
  1270.         separate parts to this construct: If and Then.  The format is:
  1271.  
  1272.            If condition Then statement
  1273.  
  1274.         (We refer to If ... Then as a command, rather than a function,
  1275.         because functions are followed by parameters in parentheses, while
  1276.         commands are not.  Commands are used for system control.)
  1277.  
  1278.         The use of If ... Then can easily be illustrated by going back to
  1279.         our WIL program and making these modifications:
  1280.  
  1281.          ________________________________________________________________
  1282.                                                                        16
  1283.  
  1284.                                                              WIL TUTORIAL
  1285.          ________________________________________________________________
  1286.  
  1287.          response = AskYesNo("Really?", "Play Solitaire now?")
  1288.          If response == @YES Then Run("sol.exe", "")
  1289.  
  1290.         In this example, we are using If ... Then to test whether the value
  1291.         of the variable response is @YES.  If it is @YES, we start
  1292.         Solitaire.  If it isn't @YES, we don't.  The rule is: if the
  1293.         condition following the If keyword is true, then the statement
  1294.         following the Then keyword is performed.  If the condition
  1295.         following the If keyword is false, then anything following the Then
  1296.         keyword is ignored.
  1297.  
  1298.         There is something extremely important that you should note about
  1299.         the syntax of the If ... Then command: the double equal signs (==).
  1300.         In WIL, a single equal sign (=) is an assignment operator  ---
  1301.         assigns the value on the right of the equal sign to the variable on
  1302.         the left of the equal sign.  As in:
  1303.  
  1304.          response = AskYesNo("Really?", "Play Solitaire now?")
  1305.  
  1306.         This is saying, in English: "Assign the value returned by the
  1307.         AskYesNo function to the variable named response."  But in the
  1308.         statement:
  1309.  
  1310.          If response == @YES Then Run("sol.exe", "")
  1311.  
  1312.         we do not want to assign a new value to response, we merely want to
  1313.         test whether it is equal to @YES.  Therefore, we use the double
  1314.         equal signs (==), which is the equality operator in WIL.  The
  1315.         statement above is saying, in English: "If the value of the
  1316.         variable named response is equal to @YES, then run the program
  1317.         SOL.EXE."  If you used a single equal sign (=) here by mistake, you
  1318.         would get an error message:
  1319.  
  1320.             ....................................................
  1321.             .   3074: Expression continues past expected end   .
  1322.             ....................................................
  1323.             .                                                  .
  1324.             .    If response == @YES Then Run("Sol.exe","")    .
  1325.             .                                                  .
  1326.             .                       [OK]                       .
  1327.             ....................................................
  1328.  
  1329.  
  1330.  
  1331.         Which is WIL's way of telling you to re-check your syntax.
  1332.  
  1333.         If you've become confused, just remember that a single equal sign
  1334.         (=) is an assignment operator, used to assign a value to a
  1335.         variable.  Double equal signs (==) are an equality operator, used
  1336.         to test whether the values on both sides of the operator are the
  1337.         same.  If you have a problem with one of your WIL programs, make
  1338.  
  1339.          ________________________________________________________________
  1340.                                                                        17
  1341.  
  1342.                                                              WIL TUTORIAL
  1343.          ________________________________________________________________
  1344.  
  1345.         sure to check whether you've used one of these symbols incorrectly.
  1346.         It's a very common mistake, which is why we emphasize it so
  1347.         strongly!
  1348.  
  1349.         We've seen what happens when the condition following the Then
  1350.         keyword is true.  But what happens when it is false?  Remember we
  1351.         said that when the If condition is false, the Then statement is
  1352.         ignored.  There will be times, however when we want to perform an
  1353.         alternate action in this circumstance.  For example, suppose we
  1354.         want to display a message if the user decides that he or she
  1355.         doesn't want to play Solitaire.  We could write:
  1356.  
  1357.          response = AskYesNo("Really?", "Play Solitaire now?")
  1358.          If response == @YES Then Run("sol.exe", "")
  1359.          If response == @NO Then Display(5, "", "Game canceled")
  1360.  
  1361.         In this case there are two If statements being evaluated, with one
  1362.         and only one of them possibly being true.  However, this is
  1363.         inefficient from a processing standpoint.  Furthermore, what would
  1364.         happen if you had several functions you wanted to perform if the
  1365.         user answered Yes?  You would end up with something unwieldy:
  1366.  
  1367.          response = AskYesNo("Really?", "Play Solitaire now?")
  1368.          If response == @YES Then Display(5, "", "On your mark ...")
  1369.          If response == @YES Then Display(5, "", "Get set ...")
  1370.          If response == @YES Then Display(5, "", "Go!")
  1371.          If response == @YES Then Run("sol.exe", "")
  1372.  
  1373.         Clearly, there must be a better way of handling this.
  1374.  
  1375.  
  1376.  
  1377.  
  1378.         Branching
  1379.         Enter the Goto command.  Goto, in combination with If ... Then,
  1380.         gives you the ability to redirect the flow of control in your WIL
  1381.         programs.  Goto does exactly what it says  ---
  1382.         of control to go to another point in the WIL program.  You must
  1383.         specify where you want the flow of control to be transferred, and
  1384.         you must mark this point with a label.  A label is simply a
  1385.         destination address, or marker.  The form of the Goto command is:
  1386.  
  1387.            Goto label
  1388.  
  1389.         where label is an identifier that you specify.  The same rules
  1390.         apply to label names as to variable names (the first character must
  1391.         be a letter, the label name may consist of any combination of
  1392.         letters and numbers, and the label name may be from 1 to 30
  1393.         characters long).  In addition, the label is preceded by a colon
  1394.         (:) at the point where it is being used as a destination address.
  1395.         Here's an example:
  1396.  
  1397.          ________________________________________________________________
  1398.                                                                        18
  1399.  
  1400.                                                              WIL TUTORIAL
  1401.          ________________________________________________________________
  1402.  
  1403.          response = AskYesNo("Really?", "Play Solitaire now?")
  1404.          If response == @NO Then Goto quit
  1405.          Display(5, "", "On your mark ...")
  1406.          Display(5, "", "Get set ...")
  1407.          Display(5, "", "Go!")
  1408.          Run("sol.exe", "")
  1409.          :quit
  1410.  
  1411.         If the If condition is true (that is, if the user answers No), then
  1412.         the Goto statement is performed.  The Goto statement is saying, in
  1413.         English "go to the line marked :quit, and continue processing from
  1414.         there."  Notice how the label quit is preceded by a colon on the
  1415.         last line, but not on the line where it follows the Goto keyword.
  1416.         This is important.  Although you can have multiple lines in your
  1417.         WIL program which say Goto quit, you can have only one line marked
  1418.         :quit (just like you can have several people going to your house,
  1419.         but can have only one house with a particular address).  Of course,
  1420.         you can use many different labels in a WIL program, just as you can
  1421.         use many different variables, as long as each has a unique name.
  1422.         For example:
  1423.  
  1424.          response = AskYesNo("Really?", "Play Solitaire now?")
  1425.          If response == @NO Then Goto quit
  1426.          Display(5, "", "On your mark ...")
  1427.          Display(5, "", "Get set ...")
  1428.          Display(5, "", "Go!")
  1429.          Run("sol.exe", "")
  1430.          Goto done
  1431.          :quit
  1432.          Display(5, "", "Game canceled")
  1433.          :done
  1434.  
  1435.         This is a little more complicated.  It uses two labels, quit and
  1436.         done.  If the user answers No, then the If condition is true,
  1437.         control passes to the line marked :quit, and a message is
  1438.         displayed.  If, on the other hand, the user answers Yes, then the
  1439.         If condition is false, and the Goto quit line is ignored.  Instead,
  1440.         the next four lines are processed, and then the Goto done statement
  1441.         is performed.  The purpose of this line is to bypass the Display
  1442.         line which follows, by transferring control to the end of the WIL
  1443.         program.  There is another way to keep the processing from "falling
  1444.         through" to unwanted lines at the end of a program, and that is
  1445.         with the Exit command.  Exit causes a WIL program to end
  1446.         immediately.  So, for example, we could rewrite the above WIL
  1447.         program as follows:
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.          ________________________________________________________________
  1456.                                                                        19
  1457.  
  1458.                                                              WIL TUTORIAL
  1459.          ________________________________________________________________
  1460.  
  1461.          response = AskYesNo("Really?", "Play Solitaire now?")
  1462.          If response == @NO Then Goto quit
  1463.          Display(5, "", "On your mark ...")
  1464.          Display(5, "", "Get set ...")
  1465.          Display(5, "", "Go!")
  1466.          Run("sol.exe", "")
  1467.          Exit
  1468.          :quit
  1469.          Display(5, "", "Game canceled")
  1470.  
  1471.         Since the Run function is the last thing we want to do if the user
  1472.         answers Yes, the Exit command simply ends the program at that
  1473.         point.  Note that we could put an Exit command at the end of the
  1474.         program as well, but it isn't necessary.  An Exit is implied at the
  1475.         end of a WIL program.
  1476.  
  1477.  
  1478.  
  1479.         This concludes the first part of our tutorial.  You now have the
  1480.         building blocks you need to create useful WIL programs.  In the
  1481.         second part, which follows, we will look in more detail at some of
  1482.         the WIL functions which are available for your use.
  1483.  
  1484.  
  1485.  
  1486.  
  1487.         Exploring WIL
  1488.         What follows is just a sample of the many functions and commands
  1489.         available in WIL.  These should be sufficient to begin creating
  1490.         versatile and powerful WIL programs.  For complete information on
  1491.         these and all WIL functions and commands, refer to the WIL Function
  1492.         Reference (pg. 67).
  1493.  
  1494.  
  1495.  
  1496.  
  1497.         Running Programs
  1498.         There are three functions which you can use to start an
  1499.         application, each of which shares a common syntax:
  1500.  
  1501.  
  1502.         Run (program-name, parameters)
  1503.         We've already seen the Run function.  This function starts a
  1504.         program in a "normal" window.  Windows, or the application itself,
  1505.         decides where to place the application's window on the screen.
  1506.  
  1507.         Example:
  1508.          Run("notepad.exe", "myfile.txt")
  1509.  
  1510.         If the program has an EXE extension, its extension may be omitted:
  1511.  
  1512.  
  1513.          ________________________________________________________________
  1514.                                                                        20
  1515.  
  1516.                                                              WIL TUTORIAL
  1517.          ________________________________________________________________
  1518.  
  1519.          Run("notepad", "myfile.txt")
  1520.  
  1521.         Also, you can "run" data files if they have an extension in WIN.INI
  1522.         which is associated with an executable program.  So, if TXT files
  1523.         are associated with Notepad:
  1524.  
  1525.          Run("myfile.txt", "")
  1526.  
  1527.         would start Notepad, using the file MYFILE.TXT.
  1528.  
  1529.         When you specify a file to run, WIL looks first in the current
  1530.         directory, and then in the directories on your DOS path.  If the
  1531.         file is not found, WIL will return an error.  You can also specify
  1532.         a full path name for WIL to use, as in:
  1533.  
  1534.          Run("c:\windows\apps\winedit.exe", "")
  1535.  
  1536.         RunZoom (program-name, parameters)
  1537.         RunZoom is like Run, but starts a program as a full-screen window.
  1538.  
  1539.         Example:
  1540.          RunZoom("excel", "bigsheet.xls")
  1541.  
  1542.         RunIcon (program-name, parameters)
  1543.         RunIcon starts a program as an icon at the bottom of the screen.
  1544.  
  1545.         Example:
  1546.          RunIcon("clock", "")
  1547.  
  1548.  
  1549.  
  1550.         Display and Input
  1551.         Here we have functions which display information to the user and
  1552.         prompt the user for information, plus a couple of relevant system
  1553.         functions.
  1554.  
  1555.  
  1556.         Display (seconds, title, text)
  1557.         Displays a message to the user for a specified period of time.  The
  1558.         message will disappear after the time expires, or after any
  1559.         keypress or mouse click.
  1560.  
  1561.         Example:
  1562.          Display(2, "", "Loading Solitaire now")
  1563.  
  1564.               ......................................
  1565.               .                                    .
  1566.               ......................................
  1567.               .                                    .
  1568.               .      Loading Solitaire now         .
  1569.               ......................................
  1570.  
  1571.          ________________________________________________________________
  1572.                                                                        21
  1573.  
  1574.                                                              WIL TUTORIAL
  1575.          ________________________________________________________________
  1576.  
  1577.  
  1578.         Message (title, text)
  1579.         This command displays a message box with a title and text you
  1580.         specify, which will remain on the screen until the user presses the
  1581.         OK button.
  1582.  
  1583.         Example:
  1584.          Message("Sorry", "That file cannot be found")
  1585.  
  1586.               ..............................
  1587.               .            Sorry           .
  1588.               ..............................
  1589.               .                            .
  1590.               . That file cannot be found  .
  1591.               .           [OK]             .
  1592.               ..............................
  1593.  
  1594.  
  1595.         Pause (title, text)
  1596.         This command is similar to Message, except an exclamation-point
  1597.         icon appears in the message box, and the user can press OK or
  1598.         Cancel.  If the user presses Cancel, the WIL program ends (or goes
  1599.         to the label :cancel, if one is defined).
  1600.  
  1601.         Example:
  1602.          Pause("Delete Backups", "Last chance to stop!")
  1603.          ; if we got this far, the user pressed OK
  1604.          FileDelete("*.bak")
  1605.  
  1606.               ..................................
  1607.               .        Delete Backups          .
  1608.               ..................................
  1609.               .                                .
  1610.               .      Last chance to stop!      .
  1611.               .                                .
  1612.               .      [OK]        [Cancel]      .
  1613.               ..................................
  1614.  
  1615.         AskYesNo (title, question)
  1616.         Displays a dialog box with a given title, which presents the user
  1617.         with three buttons: Yes, No, and Cancel.  If the user presses
  1618.         Cancel, the WIL program ends (or goes to the label :cancel, if one
  1619.         is defined).  Otherwise, the function returns a value of @YES or
  1620.         @NO.
  1621.  
  1622.  
  1623.  
  1624.         Example:
  1625.          response = AskYesNo("End Session", "Really quit Windows?")
  1626.  
  1627.  
  1628.  
  1629.          ________________________________________________________________
  1630.                                                                        22
  1631.  
  1632.                                                              WIL TUTORIAL
  1633.          ________________________________________________________________
  1634.  
  1635.               ...............................
  1636.               .         End Session         .
  1637.               ...............................
  1638.               .                             .
  1639.               .   Really quit Windows?      .
  1640.               .                             .
  1641.               .  [Yes]    [No]     [Cancel] .
  1642.               ...............................
  1643.  
  1644.  
  1645.         AskLine (title, prompt, default)
  1646.         Displays a dialog box with a given title, which prompts the user
  1647.         for a line of input.  Returns the default if the user just presses
  1648.         the OK button.
  1649.  
  1650.         Example:
  1651.          yourfile = AskLine("Edit File", "Filename:", "newfile.txt")
  1652.          Run("notepad", yourfile)
  1653.  
  1654.               ............................................
  1655.               .                                          .
  1656.               ............................................
  1657.               .  FileName:                               .
  1658.               .                                          .
  1659.               .    __________________________________    .
  1660.               .   | newfile.txt                      |   .
  1661.               .   |__________________________________|   .
  1662.               .                                          .
  1663.               .    [OK]                    [CANCEL]      .
  1664.               ............................................
  1665.  
  1666.  
  1667.         If you specify a default value (as we have with NEWFILE.TXT), it
  1668.         will appear in the response box, and will be replaced with whatever
  1669.         the user types.  If the user doesn't type anything, the default is
  1670.         used.
  1671.  
  1672.  
  1673.         Beep
  1674.         Beeps once.
  1675.  
  1676.          Beep
  1677.  
  1678.         And if one beep isn't enough for you:
  1679.  
  1680.          Beep
  1681.          Beep
  1682.          Beep
  1683.  
  1684.         Delay (seconds)
  1685.         Pauses WIL program execution.
  1686.  
  1687.          ________________________________________________________________
  1688.                                                                        23
  1689.  
  1690.                                                              WIL TUTORIAL
  1691.          ________________________________________________________________
  1692.  
  1693.         The Delay function lets you suspend processing for a fixed period
  1694.         of time, which can be anywhere from 1 to 3600 seconds.
  1695.  
  1696.  
  1697.  
  1698.  
  1699.         Manipulating Windows
  1700.         There are a large number of functions which allow you to manage the
  1701.         windows on your desktop.  Here are some of them:
  1702.  
  1703.  
  1704.         WinZoom (partial-windowname)
  1705.         Maximizes an application window to full-screen.
  1706.  
  1707.  
  1708.         WinIconize (partial-windowname)
  1709.         Turns an application window into an icon.
  1710.  
  1711.  
  1712.         WinShow (partial-windowname)
  1713.         Shows a window in its "normal" state.
  1714.  
  1715.  
  1716.  
  1717.         These three functions are used to modify the size of an already-
  1718.         running window.  WinZoom is the equivalent of selecting Maximize
  1719.         from a window's control menu, WinIconize is like selecting
  1720.         Minimize, and WinShow is like selecting Restore.
  1721.  
  1722.         The window on which you are performing any of these functions does
  1723.         not have to be the active window.  If the specified window is in
  1724.         the background, and a WinZoom or WinShow function causes the size
  1725.         of the window to change, then the window will be brought to the
  1726.         foreground.  The WinZoom function has no effect on a window which
  1727.         is already maximized; likewise, WinShow has no effect on a window
  1728.         which is already "normal."
  1729.  
  1730.         Each of these functions accepts a partial windowname as a
  1731.         parameter.  The windowname is the name which appears in the title
  1732.         bar at the top of the window.  You can specify the full name if you
  1733.         wish, but it may often be advantageous not to have to do so.  For
  1734.         example, if you are editing the file SOLITARE.WBT in a Notepad
  1735.         window, the windowname will be Notepad - SOLITARE.WBT:
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.          ________________________________________________________________
  1746.                                                                        24
  1747.  
  1748.                                                              WIL TUTORIAL
  1749.          ________________________________________________________________
  1750.               ..........................................................
  1751.               . - .          Notepad - SOLITARE.WBT                    .
  1752.               ..........................................................
  1753.               .  File  Edit  Search  Help                              .
  1754.               ..........................................................
  1755.               .                                                        .
  1756.               .                                                        .
  1757.               .    {Contents of solitare.wbt shown here}               .
  1758.               .                                                        .
  1759.               .                                                        .
  1760.               .                                                        .
  1761.               .                                                        .
  1762.               .                                                        .
  1763.               .                                                        .
  1764.               .                                                        .
  1765.               .                                                        .
  1766.               .                                                        .
  1767.               .                                                        .
  1768.               ..........................................................
  1769.  
  1770.         You probably don't want to have to hard-code this entire name into
  1771.         your WIL program as:
  1772.  
  1773.          WinZoom("Notepad - SOLITARE.WBT")
  1774.  
  1775.         Instead, you can specify the partial windowname "Notepad":
  1776.  
  1777.          WinZoom("Notepad")
  1778.  
  1779.         If you have more than one Notepad window open, WIL will use the one
  1780.         which was most recently used or started.
  1781.  
  1782.         Note that WIL matches the partial windowname beginning with the
  1783.         first character, so that while
  1784.  
  1785.          WinZoom("Note")
  1786.  
  1787.         would be correct,
  1788.  
  1789.          WinZoom("pad")
  1790.  
  1791.         would not result in a match.
  1792.  
  1793.         Also, the case (upper or lower) of the title is significant, so
  1794.  
  1795.          WinZoom("notepad")
  1796.  
  1797.         would not work either.
  1798.  
  1799.  
  1800.         WinActivate (partial-windowname)
  1801.         Makes an application window the active window.
  1802.  
  1803.          ________________________________________________________________
  1804.                                                                        25
  1805.  
  1806.                                                              WIL TUTORIAL
  1807.          ________________________________________________________________
  1808.  
  1809.         This function makes a currently-open window the active window.  If
  1810.         the specified window is an icon, it will be restored to normal
  1811.         size; otherwise, its size will not be changed.
  1812.  
  1813.  
  1814.         WinClose (partial-windowname)
  1815.         Closes an application window.
  1816.  
  1817.         This is like selecting Close from an application's control menu.
  1818.         You will still receive any closing message(s) that the application
  1819.         would normally give you, such as an "unsaved-file" dialog box.
  1820.  
  1821.  
  1822.         WinCloseNot (partial-windowname
  1823.              [, partial-windowname]...)
  1824.         Closes all application windows except those specified.
  1825.  
  1826.         This function lets you close all windows except the one(s) you want
  1827.         to remain open.  For example:
  1828.  
  1829.          WinCloseNot("Program Man")
  1830.  
  1831.         would leave only the Program Manager open, and:
  1832.  
  1833.          WinCloseNot("Program Man", "Solit")
  1834.  
  1835.         would leave the Program Manager and Solitaire windows open.
  1836.  
  1837.  
  1838.         WinWaitClose (partial-windowname)
  1839.         Waits until an application window is closed.
  1840.  
  1841.         This function causes your WIL program to pause until you have
  1842.         manually closed a specified window.  This is a convenient way to
  1843.         get WIL to open several windows sequentially, thereby not having
  1844.         unnecessary windows all over your desktop.  For example:
  1845.  
  1846.          RunZoom("invoices.xls", "")        ;balance the books
  1847.          WinWaitClose("Microsoft Ex")       ;wait till Excel closed
  1848.          RunZoom("sol", "")                 ;you deserve a break
  1849.          WinWaitClose("Solitaire")          ;wait until Solit closed
  1850.          Run("winword", "agenda.doc")       ;more paperwork
  1851.          WinWaitClose("Microsoft Wor")      ;wait until W4W closed
  1852.          Run("clock","")                    ;lunchtime yet?
  1853.  
  1854.  
  1855.         WinExist (partial-windowname)
  1856.         Tells if a window exists.
  1857.  
  1858.  
  1859.  
  1860.  
  1861.          ________________________________________________________________
  1862.                                                                        26
  1863.  
  1864.                                                              WIL TUTORIAL
  1865.          ________________________________________________________________
  1866.  
  1867.         This function returns @TRUE or @FALSE, depending on whether a
  1868.         matching window can be found.  This provides a way of insuring that
  1869.         only one copy of a given window will be open at a time.
  1870.  
  1871.         If you've been following this tutorial faithfully from the
  1872.         beginning, you probably have several copies of Solitaire running at
  1873.         the moment.  (You can check by pressing Ctrl-Esc and bringing up
  1874.         the Task Manager.  You say you've got five Solitaire windows open?
  1875.         Okay, close them all.)  Now, let's modify our WIL program.  First,
  1876.         trim out the excess lines so that it looks like this:
  1877.  
  1878.          Run("sol.exe", "")
  1879.  
  1880.         Now, let's use the WinExist function to make sure that the WIL
  1881.         program only starts Solitaire if it isn't already running:
  1882.  
  1883.          If WinExist("Solitaire") == @FALSE Then Run("sol.exe", "")
  1884.  
  1885.         And this should work fine.  Run the WIL program twice now, and see
  1886.         what happens.  The first time you run it, it should start
  1887.         Solitaire; the second (and subsequent) time, it should not do
  1888.         anything.
  1889.  
  1890.         However, it's quite likely that you want the WIL program to do
  1891.         something if Solitaire is already running  ---
  1892.         Solitaire window to the foreground.  This can be accomplished by
  1893.         using the WinActivate function, along with a couple of Goto
  1894.         statements:
  1895.  
  1896.          If WinExist("Solitaire") == @FALSE Then Goto open
  1897.          WinActivate("Solitaire")
  1898.          Goto loaded
  1899.          :open
  1900.          Run("sol.exe", "")
  1901.          :loaded
  1902.  
  1903.         Note that we can change this to have WinExist check for a True
  1904.         value instead, by modifying the structure of the WIL program:
  1905.  
  1906.          If WinExist("Solitaire") == @TRUE Then Goto activate
  1907.          Run("sol.exe", "")
  1908.          Goto loaded
  1909.          :activate
  1910.          WinActivate("Solitaire")
  1911.          :loaded
  1912.  
  1913.         Either format is perfectly correct, and the choice of which to use
  1914.         is merely a matter of personal style.  The result is exactly the
  1915.         same.
  1916.  
  1917.  
  1918.  
  1919.          ________________________________________________________________
  1920.                                                                        27
  1921.  
  1922.                                                              WIL TUTORIAL
  1923.          ________________________________________________________________
  1924.  
  1925.  
  1926.         EndSession ( )
  1927.         Ends the current Windows session.
  1928.  
  1929.         This does exactly what it says.  It will not ask any questions
  1930.         (although you will receive any closing messages that your
  1931.         currently-open windows would normally display), so you may want to
  1932.         build in a little safety net:
  1933.  
  1934.          sure = AskYesNo("End Session", "Really quit Windows?")
  1935.          If sure == @YES Then EndSession()
  1936.  
  1937.         EndSession is an example of a WIL function which does not take any
  1938.         parameters, as indicated by the empty parentheses which follow it.
  1939.         The parentheses are still required, though.
  1940.  
  1941.  
  1942.  
  1943.  
  1944.         Files and Directories
  1945.  
  1946.         DirChange (pathname)
  1947.         Changes the directory to the pathname specified.
  1948.  
  1949.         Use this function when you want to run a program which must be
  1950.         started from its own directory.  "Pathname" may optionally include
  1951.         a drive letter.
  1952.  
  1953.         Example:
  1954.          DirChange("c:\windows\winword")
  1955.          Run("winword.exe", "")
  1956.  
  1957.         DirGet ( )
  1958.         Gets the current working directory.
  1959.  
  1960.         This function is especially useful in conjunction with DirChange,
  1961.         to save and then return to the current directory.
  1962.  
  1963.         Example:
  1964.          origdir = DirGet()
  1965.          DirChange("c:\windows\winword")
  1966.          Run("winword.exe", "")
  1967.          DirChange(origdir)
  1968.  
  1969.         FileExist (filename)
  1970.         Determines if a file exists.
  1971.  
  1972.         This function will return @TRUE if the specified file exists, and
  1973.         @FALSE if it doesn't exist.
  1974.  
  1975.  
  1976.  
  1977.          ________________________________________________________________
  1978.                                                                        28
  1979.  
  1980.                                                              WIL TUTORIAL
  1981.          ________________________________________________________________
  1982.  
  1983.         Example:
  1984.          If FileExist("win.bak") == @FALSE Then FileCopy("win.ini",
  1985.              "win.bak", @FALSE)
  1986.          Run("notepad.exe", "win.ini")
  1987.  
  1988.  
  1989.         FileCopy (from-list, to-file, warning)
  1990.         Copies files.
  1991.  
  1992.         If warning is @TRUE, WIL will pop up a dialog box warning you if
  1993.         you are about to overwrite an existing file, and giving you an
  1994.         opportunity to change your mind.  If warning is @FALSE, it will
  1995.         overwrite existing files with no warning.
  1996.  
  1997.         Example:
  1998.          FileCopy("win.ini", "*.sav", @TRUE)
  1999.          Run("notepad.exe", "win.ini")
  2000.  
  2001.         The asterisk (*) is a wildcard character, which matches any letter
  2002.         or group of letters in a file name.  In this case, it will cause
  2003.         WIN.INI to be copied as WIN.SAV.
  2004.  
  2005.  
  2006.         FileDelete (file-list)
  2007.         Deletes files.
  2008.  
  2009.         Example:
  2010.          If FileExist("win.bak") == @TRUE Then FileDelete("win.bak")
  2011.  
  2012.  
  2013.         FileRename (from-list, to-file)
  2014.         Renames files to another set of names.
  2015.  
  2016.  
  2017.  
  2018.         We can illustrate the use of these WIL program functions with a
  2019.         typical WIL application.  Let's suppose that our word processor
  2020.         saves a backup copy of each document, with a BAK extension, but we
  2021.         want a larger safety net when editing important files.  We want to
  2022.         keep the five most recent versions of the wonderful software manual
  2023.         we're writing.  Here's a WIL program to accomplish this:
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.          ________________________________________________________________
  2036.                                                                        29
  2037.  
  2038.                                                              WIL TUTORIAL
  2039.          ________________________________________________________________
  2040.  
  2041.          If FileExist("wil.bak") == @TRUE Then Goto backup
  2042.          :edit
  2043.          Run("winword.exe", "wil.doc")
  2044.          Exit
  2045.          :backup
  2046.          FileDelete("wil.bk5")
  2047.          FileRename("wil.bk4", "wil.bk5)
  2048.          FileRename("wil.bk3", "wil.bk4)
  2049.          FileRename("wil.bk2", "wil.bk3)
  2050.          FileRename("wil.bk1", "wil.bk2)
  2051.          FileRename("wil.bak", "wil.bk1)
  2052.          Goto edit
  2053.  
  2054.         If the file WIL.BAK exists, it means that we have made a change to
  2055.         WIL.DOC.  So, before we start editing, we delete the oldest backup
  2056.         copy, and perform several FileRename functions, until eventually
  2057.         WIL.BAK becomes WIL.BK1.  Notice how the flow of control moves to
  2058.         the line labeled :backup, and then back to the line labeled :edit,
  2059.         and how we terminate processing with the Exit command.  If we did
  2060.         not include the Exit command, the WIL program would continue in an
  2061.         endless loop.
  2062.  
  2063.         However, this still isn't quite right.  What would happen if the
  2064.         file WIL.BK5 didn't exist?  In the DOS batch language, we would get
  2065.         an error message, and processing would continue.  But in WIL, the
  2066.         error would cause the WIL program to terminate:
  2067.  
  2068.               .................................................
  2069.               .   1017  File Delete:  No matching files found .
  2070.               .................................................
  2071.               .                                               .
  2072.               .    FileDelete("WIL.BK5")                      .
  2073.               .                                               .
  2074.               .                                               .
  2075.               .                    [OK]                       .
  2076.               .................................................
  2077.  
  2078.  
  2079.         There are two ways that we can handle this.  We could use an If
  2080.         FileExist test before every file operation, and test the returned
  2081.         value for a @TRUE before proceeding.  But this is clumsy, even with
  2082.         such a small WIL program, and would become unwieldy with a larger
  2083.         one.
  2084.  
  2085.  
  2086.  
  2087.  
  2088.         Handling Errors
  2089.         Luckily, there is a WIL system function to help us here: ErrorMode.
  2090.         The ErrorMode function lets you decide what will happen if an error
  2091.         occurs during WIL processing.  Here's the syntax:
  2092.  
  2093.          ________________________________________________________________
  2094.                                                                        30
  2095.  
  2096.                                                              WIL TUTORIAL
  2097.          ________________________________________________________________
  2098.  
  2099.  
  2100.         ErrorMode (mode)
  2101.         Specifies how to handle errors.
  2102.  
  2103.  
  2104.         Parameters:
  2105.          (i) mode =   @CANCEL, @NOTIFY, or @OFF.
  2106.  
  2107.         Returns:
  2108.          (i)          previous error setting.
  2109.  
  2110.         Use this command to control the effects of runtime errors.  The
  2111.         default is @CANCEL, meaning the execution of the WIL program will
  2112.         be canceled for any error.
  2113.  
  2114.         @CANCEL:  All runtime errors will cause execution to be canceled.
  2115.         The user will be notified which error occurred.
  2116.  
  2117.         @NOTIFY:  All runtime errors will be reported to the user, and they
  2118.         can choose to continue if it isn't fatal.
  2119.  
  2120.         @OFF:  Minor runtime errors will be suppressed. Moderate and fatal
  2121.         errors will be reported to the user.  User has the option of
  2122.         continuing if the error is not fatal.
  2123.  
  2124.         As you can see, the default mode is @CANCEL, and it's a good idea
  2125.         to leave it like this.  However, it is quite reasonable to change
  2126.         the mode for sections of your WIL program where you anticipate
  2127.         errors occurring.  This is just what we've done in our modified WIL
  2128.         program:
  2129.  
  2130.          If FileExist("wil.bak") == @TRUE Then Goto backup
  2131.          :edit
  2132.          Run("winword.exe", "wil.doc")
  2133.          Exit
  2134.          :backup
  2135.          ErrorMode(@OFF)
  2136.          FileDelete("wil.bk5")
  2137.          FileRename("wil.bk4", "wil.bk5)
  2138.          FileRename("wil.bk3", "wil.bk4)
  2139.          FileRename("wil.bk2", "wil.bk3)
  2140.          FileRename("wil.bk1", "wil.bk2)
  2141.          FileRename("wil.bak", "wil.bk1)
  2142.          ErrorMode(@CANCEL)
  2143.          Goto edit
  2144.  
  2145.         Notice how we've used ErrorMode(@OFF) to prevent errors in the
  2146.         section labeled backup: from aborting the WIL program, and then
  2147.         used ErrorMode(@CANCEL) at the end of the that section to change
  2148.         back to the default error mode.  This is a good practice to follow.
  2149.  
  2150.  
  2151.          ________________________________________________________________
  2152.                                                                        31
  2153.  
  2154.                                                              WIL TUTORIAL
  2155.          ________________________________________________________________
  2156.  
  2157.  
  2158.  
  2159.  
  2160.         Selection Menus
  2161.         So far, whenever we have needed to use a file name, we've hard-
  2162.         coded it into our WIL programs.  For example:
  2163.  
  2164.          Run("notepad.exe", "agenda.txt")
  2165.  
  2166.         Naturally, there should be a way to get this information from the
  2167.         user "on the fly", so that we wouldn't have to write hundreds of
  2168.         different WIL program.  And there is a way.  Three or four ways,
  2169.         actually.  Consider, first, a function that we have already seen,
  2170.         AskLine:
  2171.  
  2172.          file = AskLine("", "Enter Filename to edit?", "")
  2173.          Run("notepad.exe", file)
  2174.  
  2175.         This will prompt for a filename, and run Notepad on that file:
  2176.  
  2177.               ..................................................
  2178.               .                                                .
  2179.               ..................................................
  2180.               .                                                .
  2181.               .  Enter Filename to edit?                       .
  2182.               .                                                .
  2183.               .   ___________________________________________  .
  2184.               .  |                                           | .
  2185.               .  |___________________________________________| .
  2186.               .                                                .
  2187.               .         [OK]                 [Cancel]          .
  2188.               .                                                .
  2189.               ..................................................
  2190.  
  2191.         There are only three problems with this approach.  First, the user
  2192.         might not remember the name of the file.  Second, the user might
  2193.         enter the name incorrectly.  And finally, modern software is
  2194.         supposed to be sophisticated and user-friendly enough to handle
  2195.         these things the right way.  And WIL certainly can.
  2196.  
  2197.         There are two new functions we need to use for an improved file
  2198.         selection routine: FileItemize and ItemSelect.
  2199.  
  2200.  
  2201.         FileItemize (file-list)
  2202.         Returns a space-delimited list of files.
  2203.  
  2204.         This function compiles a list of filenames and separates the names
  2205.         with spaces.  There are several variations we can use:
  2206.  
  2207.          FileItemize("*.doc")
  2208.  
  2209.          ________________________________________________________________
  2210.                                                                        32
  2211.  
  2212.                                                              WIL TUTORIAL
  2213.          ________________________________________________________________
  2214.  
  2215.  
  2216.         would give us a list of all files in the current directory with a
  2217.         DOC extension,
  2218.  
  2219.          FileItemize("*.com *.exe")
  2220.  
  2221.         would give us a list of all files in the current directory with a
  2222.         COM or EXE extension, and
  2223.  
  2224.          FileItemize("*.*")
  2225.  
  2226.         would give us a list of all files in the current directory.
  2227.  
  2228.         Of course, we need to be able to use this list, and for that we
  2229.         have:
  2230.  
  2231.  
  2232.         ItemSelect (title, list, delimiter)
  2233.         Displays a listbox filled with items from a list you specify in a
  2234.         string.  The items are separated in your string by a delimiter
  2235.         character.
  2236.  
  2237.         This is the function which actually displays the list box.
  2238.         Remember that FileItemize returns a file list delimited by spaces,
  2239.         which would look something like this:
  2240.  
  2241.            FILE1.DOC FILE2.DOC FILE3.DOC
  2242.  
  2243.         When we use ItemSelect, we need to tell it that the delimiter is a
  2244.         space.  We do this as follows:
  2245.  
  2246.          textfiles = FileItemize("*.doc *.txt")
  2247.          yourfile = ItemSelect("Select file to edit", textfiles, " ")
  2248.          Run("notepad.exe", yourfile)
  2249.  
  2250.               ....................................................
  2251.               .                Select file to edit               .
  2252.               ....................................................
  2253.               .    ____________________________________________  .
  2254.               .   |  WINBATCH.DOC                              | .
  2255.               .   |  CMDPOST.DOC                               | .
  2256.               .   |  SYSINI.TXT                                | .
  2257.               .   |  SYSINI2.TXT                               | .
  2258.               .   |  WININI.TXT                                | .
  2259.               .   |  WININI2.TXT                               | .
  2260.               .   |                                            | .
  2261.               .   |                                            | .
  2262.               .   |____________________________________________| .
  2263.               .                                                  .
  2264.               .       [OK]                      [Cancel]         .
  2265.               ....................................................
  2266.  
  2267.          ________________________________________________________________
  2268.                                                                        33
  2269.  
  2270.                                                              WIL TUTORIAL
  2271.          ________________________________________________________________
  2272.  
  2273.  
  2274.  
  2275.         First, we use FileItemize to build a list of filenames with DOC and
  2276.         TXT extensions.  We assign this list to the variable textfiles.
  2277.         Then, we use the ItemSelect function to build a list box, passing
  2278.         it the variable textfiles as its second parameter.  The third
  2279.         parameter we use for ItemSelect is simply a space with quote marks
  2280.         around it; this tells ItemSelect that the variable textfiles is
  2281.         delimited by spaces.  (Note that this is different from the null
  2282.         string that we've seen earlier  ---
  2283.         between the quote marks.)  Finally, we assign the value returned by
  2284.         ItemSelect to the variable yourfile, and run Notepad using that
  2285.         file.
  2286.  
  2287.         In the list box, if the user presses Enter or clicks on the OK
  2288.         button without a file being highlighted, ItemSelect returns a null
  2289.         string.  If you want, you can test for this condition:
  2290.  
  2291.          textfiles = FileItemize("*.doc *.txt")
  2292.          :retry
  2293.          yourfile = ItemSelect("Select file to edit", textfiles, " ")
  2294.          If yourfile == "" Then Goto retry
  2295.          Run("notepad.exe", yourfile)
  2296.  
  2297.         DirItemize (dir-list)
  2298.         Returns a space-delimited list of directories.
  2299.  
  2300.         This function is similar to FileItemize, but instead of returning a
  2301.         list of files, it returns a list of directories.  Remember we said
  2302.         that FileItemize only lists files in the current directory.  Often,
  2303.         we want to be able to use files in other directories as well.  We
  2304.         can do this by first letting the user select the appropriate
  2305.         directory, using the DirItemize and ItemSelect combination:
  2306.  
  2307.          DirChange("\")
  2308.          subdirs = DirItemize("*")
  2309.          targdir = ItemSelect("Select dir", subdirs, " ")
  2310.              DirChange(targdir)
  2311.          files = FileItemize("*.*")
  2312.          file = ItemSelect("Select file", files, " ")
  2313.          Run("notepad.exe", file)
  2314.  
  2315.         First we change to the root directory.  Then we use DirItemize to
  2316.         get a list of all the subdirectories off of the root directory.
  2317.         Next, we use ItemSelect to give us a list box of directories from
  2318.         which to select.  Finally, we change to the selected directory, and
  2319.         use FileItemize and ItemSelect to pick a file.
  2320.  
  2321.         Although this WIL program works, it needs to be polished up a bit.
  2322.         What happens if the file we want is in the \WINDOWS\BATCH
  2323.         directory?  Our WIL program doesn't go more than one level deep
  2324.  
  2325.          ________________________________________________________________
  2326.                                                                        34
  2327.  
  2328.                                                              WIL TUTORIAL
  2329.          ________________________________________________________________
  2330.  
  2331.         from the root directory.  We want  to continue down the directory
  2332.         tree, but we also need a way of telling when we're at the end of a
  2333.         branch.  As it happens, there is such a way: DirItemize will return
  2334.         a null string if there are no directories to process.  Given this
  2335.         knowledge, we can set up a loop to test when we are at the lowest
  2336.         level:
  2337.  
  2338.          DirChange("\")
  2339.          :getdir
  2340.          subdirs = DirItemize("*")
  2341.          If subdirs == "" Then Goto getfile
  2342.          targdir = ItemSelect("Select dir (OK = curr)", subdirs, " ")
  2343.          If targdir == "" Then Goto getfile
  2344.          DirChange(targdir)
  2345.          Goto getdir
  2346.          :getfile
  2347.          files = FileItemize("*.*")
  2348.          file = ItemSelect("Select file", files, " ")
  2349.          If file == "" Then Goto getfile
  2350.          Run("notepad.exe", file)
  2351.  
  2352.         After we use the DirItemize function, we test the returned value
  2353.         for a null string.  If we have a null string, then we know that the
  2354.         current directory has no subdirectories, and so we proceed to
  2355.         select the filename from the current directory (Goto getfile).  If,
  2356.         however, DirItemize returns a non-blank list, then we know that
  2357.         there is, in fact, at least one subdirectory.  In that case, we use
  2358.         ItemSelect to present the user with a list box of directories.
  2359.         Then, we test the value returned by ItemSelect.  If the returned
  2360.         value is a null string, it means that the user did not select a
  2361.         directory from the list, and presumably wants a file in the current
  2362.         directory.  We happily oblige (Goto getfile).  On the other hand, a
  2363.         non-blank value returned by ItemSelect indicates that the user has
  2364.         selected a subdirectory from the list box.  In that case, we change
  2365.         to the selected directory, and loop back to the beginning of the
  2366.         directory selection routine (Goto getdir).  We continue this
  2367.         process until either (a) the user selects a directory, or (b) there
  2368.         are no directories left to select.  Eventually, we get to the
  2369.         section labeled :getfile.
  2370.  
  2371.  
  2372.  
  2373.  
  2374.         Nicer File Selection
  2375.         An even more elegant way of selecting a file name is provided by
  2376.         the Dialog function (pg. 97), which also allows the user to select
  2377.         various options via check boxes and radio buttons.
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.          ________________________________________________________________
  2384.                                                                        35
  2385.  
  2386.                                                              WIL TUTORIAL
  2387.          ________________________________________________________________
  2388.  
  2389.  
  2390.  
  2391.  
  2392.         Nicer Messages
  2393.         Have you tried displaying long messages, and found that WIL didn't
  2394.         wrap the lines quite the way you wanted?  Here are a couple of
  2395.         tricks.
  2396.  
  2397.  
  2398.         Num2Char (integer)
  2399.         Converts a number to its character equivalent.
  2400.  
  2401.         We want to be able to insert a carriage return/line feed
  2402.         combination at the end of each line in our output, and the Num2Char
  2403.         function will let us do that.  A carriage return has an ASCII value
  2404.         of 13, and a line feed has an ASCII value of 10 (don't worry if you
  2405.         don't understand what this sentence means).  To be able to use
  2406.         these values, we must convert them to characters, as follows:
  2407.  
  2408.          cr = Num2Char(13)
  2409.          lf = Num2Char(10)
  2410.  
  2411.         Now, we need to be able to place the variables cr and lf in our
  2412.         message.  For example, let's say we want to do this:
  2413.  
  2414.          Message("", "This is line one This is line two")
  2415.  
  2416.         If we just inserted the variables into the string, as in:
  2417.  
  2418.          cr = Num2Char(13)
  2419.          lf = Num2Char(10)
  2420.          Message("", "This is line one cr lf This is line two")
  2421.  
  2422.         we would not get the desired effect.  WIL would simply treat them
  2423.         as ordinary text:
  2424.  
  2425.               ...............................................
  2426.               .                                             .
  2427.               ...............................................
  2428.               .                                             .
  2429.               .   This is line one cr lf This is line two   .
  2430.               .                                             .
  2431.               .                   [OK]                      .
  2432.               ...............................................
  2433.  
  2434.  
  2435.  
  2436.         However, WIL does provide us with a method of performing variable
  2437.         substitution such as this, and that is by delimiting the variables
  2438.         with percentage signs (%).  If we do this:
  2439.  
  2440.  
  2441.          ________________________________________________________________
  2442.                                                                        36
  2443.  
  2444.                                                              WIL TUTORIAL
  2445.          ________________________________________________________________
  2446.  
  2447.          cr = Num2Char(13)
  2448.          lf = Num2Char(10)
  2449.          Message("", "This is line one %cr% %lf%This is line two")
  2450.  
  2451.         we will get what we want:
  2452.  
  2453.               .............................
  2454.               .                           .
  2455.               .............................
  2456.               .                           .
  2457.               .     This is line one      .
  2458.               .                           .
  2459.               .     This is line two      .
  2460.               .                           .
  2461.               .           [OK]            .
  2462.               .............................
  2463.  
  2464.  
  2465.         Note that there is no space after %lf%; this is so that the second
  2466.         line will be aligned with the first line (every space within the
  2467.         delimiting quote marks of a string variable is significant).
  2468.  
  2469.         Now, wouldn't it be convenient if we could combine cr and lf into a
  2470.         single variable?  We can.
  2471.  
  2472.  
  2473.         StrCat (string[, string]...)
  2474.         Concatenates strings together.
  2475.  
  2476.         The StrCat function lets us combine any number of string constants
  2477.         and/or string variables.  Here's how we combine the variables cr
  2478.         and lf into the single variable crlf:
  2479.  
  2480.          crlf = StrCat(cr, lf)
  2481.  
  2482.         Note that the strings to be concatenated are separated by commas,
  2483.         within the parentheses.  Now, we can rewrite our example, as
  2484.         follows:
  2485.  
  2486.          cr = Num2Char(13)
  2487.          lf = Num2Char(10)
  2488.          crlf = StrCat(cr, lf)
  2489.          Message("", "This is line one %crlf%This is line two")
  2490.  
  2491.         If we wanted to re-use this message a number of times, it would be
  2492.         quite convenient to use the StrCat function to make a single
  2493.         variable out of it:
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.          ________________________________________________________________
  2500.                                                                        37
  2501.  
  2502.                                                              WIL TUTORIAL
  2503.          ________________________________________________________________
  2504.  
  2505.          cr = Num2Char(13)
  2506.          lf = Num2Char(10)
  2507.          crlf = StrCat(cr, lf)
  2508.          line1 = "This is line one"
  2509.          line2 = "This is line two"
  2510.          mytext = StrCat(line1, crlf, line2)
  2511.          Message("", mytext)
  2512.  
  2513.  
  2514.  
  2515.         Running DOS Programs
  2516.         WIL can run DOS programs, just like it runs Windows programs:
  2517.  
  2518.          DirChange("c:\game")
  2519.          Run("scramble.exe", "")
  2520.  
  2521.         If you want to use an internal DOS command, such as DIR or TYPE,
  2522.         you can do so by running the DOS command interpreter, COMMAND.COM,
  2523.         with the /c program parameter, as follows:
  2524.  
  2525.          Run("command.com", "/c type readme.txt")
  2526.  
  2527.         Everything that you would normally type on the DOS command line
  2528.         goes after the /c in the second parameter.  Here's another example:
  2529.  
  2530.          Run("command.com", "/c type readme.txt | more")
  2531.  
  2532.         These examples assume that COMMAND.COM is in a directory on your
  2533.         DOS path.  If it isn't, you could specify a full path name for it:
  2534.  
  2535.          Run("c:\command.com", "/c type readme.txt | more")
  2536.  
  2537.         Or, better still, you could use the WIL Environment function.
  2538.  
  2539.  
  2540.         Environment (env-variable)
  2541.         Gets a DOS environment variable.
  2542.  
  2543.         Since DOS always stores the full path and filename of the command
  2544.         processor in the DOS environment variable COMSPEC, it is an easy
  2545.         matter to retrieve this information:
  2546.  
  2547.          coms = Environment("COMSPEC")
  2548.  
  2549.         and use it in our WIL program:
  2550.  
  2551.          coms = Environment("COMSPEC")
  2552.          Run(coms, "/c type readme.txt")
  2553.  
  2554.         To get a DOS window, just run COMMAND.COM with no parameters:
  2555.  
  2556.  
  2557.          ________________________________________________________________
  2558.                                                                        38
  2559.  
  2560.                                                              WIL TUTORIAL
  2561.          ________________________________________________________________
  2562.  
  2563.          coms = Environment("COMSPEC")
  2564.          Run(coms, "")
  2565.  
  2566.  
  2567.  
  2568.         Sending Keystrokes to Programs
  2569.         Here we come to one of the most useful and powerful features of
  2570.         WIL: the ability to send keystrokes to Windows programs, just as if
  2571.         you were typing them directly from the keyboard.
  2572.  
  2573.  
  2574.         SendKey (character-codes)
  2575.         Sends keystrokes to the active application.
  2576.  
  2577.         This is an ideal way to make the computer automatically type the
  2578.         keystrokes that you enter every time you start a certain program.
  2579.         For example, to start up Notepad and have it prompt you for a file
  2580.         to open, you would use:
  2581.  
  2582.          Run("notepad.exe", "")
  2583.          SendKey("!fo")
  2584.  
  2585.         The parameter you specify for SendKey is the string that you want
  2586.         sent to the program.  This string consists of standard characters,
  2587.         as well as some special characters which you will find listed under
  2588.         the entry for SendKey in the WIL Function Reference (pg. 216).  In
  2589.         the example above, the exclamation mark (!) stands for the Alt key,
  2590.         so !f is the equivalent of pressing and holding down the Alt key
  2591.         while simultaneously pressing the F key.  The o in the example
  2592.         above is simply the letter O, and is the same as pressing the O key
  2593.         by itself:
  2594.  
  2595.              |-----------------------------~
  2596.              |   <<File>>   Edit   Search
  2597.              |-----------------------------~
  2598.              |   New            |
  2599.              | <<Open>>         |
  2600.              |   Save           |
  2601.              |   Save As        |
  2602.              |   Print          |
  2603.              |   Page Setup     |
  2604.              |   Printer Setup  |
  2605.              |------------------|
  2606.              |   Exit           |
  2607.              --------------------
  2608.  
  2609.         Here's another example:
  2610.  
  2611.          RunZoom("sol.exe", "")
  2612.          SendKey("!gc{RIGHT}{SP}~")
  2613.  
  2614.  
  2615.          ________________________________________________________________
  2616.                                                                        39
  2617.  
  2618.                                                              WIL TUTORIAL
  2619.          ________________________________________________________________
  2620.  
  2621.         This starts up Solitaire, brings up the Game menu (!g), and selects
  2622.         Deck (c) from that menu:
  2623.  
  2624.                |-----------------------~
  2625.                |   <<Game>>  Help
  2626.                |-----------------------~
  2627.                |   Deal       |
  2628.                |--------------|
  2629.                |   Undo       |
  2630.                | <<Deck>>     |
  2631.                |   Options    |
  2632.                |--------------|
  2633.                |   Exit       |
  2634.                ----------------
  2635.  
  2636.         Then it moves the cursor to the next card back style on the right
  2637.         ({RIGHT}), selects that card back ({SP}), and then selects OK (~).
  2638.  
  2639.               ............................................
  2640.               .              Select Card Deck            .
  2641.               ............................................
  2642.               .   xxxxx   ooooo   vvvvv   bbbbb   zzzzz  .
  2643.               .   xxxxx   ooooo   vvvvv   bbbbb   zzzzz  .
  2644.               .   xxxxx   ooooo   vvvvv   bbbbb   zzzzz  .
  2645.               .   xxxxx   ooooo   vvvvv   bbbbb   zz zz  .
  2646.               .                                          .
  2647.               .   fffff   ttttt   uuuuu   aaaaa   hhhhh  .
  2648.               .   fffff   ttttt   uuuuu   aaaaa   hhhhh  .
  2649.               .   fffff   ttttt   uuuuu   aaaaa   hhhhh  .
  2650.               .   fffff   ttttt   uuuuu   aaaaa   hhhhh  .
  2651.               .                                          .
  2652.               .        [OK]                [Cancel]      .
  2653.               ............................................
  2654.  
  2655.  
  2656.  
  2657.  
  2658.         And voila!  A different card design every time you play!
  2659.  
  2660.  
  2661.  
  2662.  
  2663.         Our Completed WIL File
  2664.         Here is the final working version of the WIL program that we've
  2665.         slowly been building throughout this tutorial:
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.          ________________________________________________________________
  2674.                                                                        40
  2675.  
  2676.  
  2677.          ________________________________________________________________
  2678.  
  2679.          ; solitare.wbt
  2680.          mins = AskLine("Solitaire", "How many minutes to play?","")
  2681.          If WinExist("Solitaire") == @TRUE Then Goto activate
  2682.          RunZoom("sol.exe", "")
  2683.          Goto loaded
  2684.          :activate
  2685.          WinActivate("Solitaire")
  2686.          WinZoom("Solitaire")
  2687.          :loaded
  2688.          SendKey("!gc{RIGHT}{SP}~")
  2689.          goal = mins * 60
  2690.          timer = 0
  2691.          :moretime
  2692.          remain = goal - timer
  2693.          WinTitle("Solitaire", "Solitaire (%remain% seconds left)")
  2694.          Delay(10)
  2695.          timer = timer + 10
  2696.          If WinExist("Solitaire") == @FALSE Then Exit
  2697.          If timer < goal Then Goto moretime
  2698.          Beep
  2699.          WinClose("Solitaire")
  2700.          Message("Time's up", "Get back to work!")
  2701.  
  2702.         It incorporates many of the concepts that we've discussed so far,
  2703.         as well as using some arithmetic (*, -, +) and relational (<)
  2704.         operators that are covered in the section on the WIL Language (pg.
  2705.         45).
  2706.  
  2707.         It can also be improved and customized in a number of ways, but
  2708.         we'll leave that up to you.
  2709.  
  2710.         If you can understand and follow the structures and processes
  2711.         illustrated in this sample file, and can begin to incorporate them
  2712.         into your own WIL programs, you are well on your way to becoming a
  2713.         true WIL guru!
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.          ________________________________________________________________
  2732.                                                                        41
  2733.  
  2734.                                                            THINGS TO KNOW
  2735.          ________________________________________________________________
  2736.  
  2737.  
  2738.                                    THINGS TO KNOW
  2739.  
  2740.         This section covers some miscellaneous items, of a more advanced
  2741.         nature.
  2742.  
  2743.  
  2744.  
  2745.  
  2746.         Recovering from Cancel
  2747.         If the user presses the Cancel button (in any dialog which has
  2748.         one), the label :CANCEL will be searched for in the WIL program,
  2749.         and, if found, control will be transferred there.  If no label
  2750.         :CANCEL is found, processing simply stops.
  2751.  
  2752.         This allows the program developer to perform various bits of
  2753.         cleanup processing after a user presses Cancel.
  2754.  
  2755.  
  2756.  
  2757.  
  2758.         Aborting WIL processing
  2759.         A currently-executing WIL program can be terminated immediately by
  2760.         pressing the <Ctrl-Shift-Break> key combination.
  2761.  
  2762.  
  2763.  
  2764.  
  2765.         Default program for unknown extension
  2766.         The Run function (and related members of the Run... family of
  2767.         functions) allow you to run a data file if it is associated with a
  2768.         program via the [Extensions] section of the WIN.INI file.  You can
  2769.         also (optionally) create a special default program entry in that
  2770.         section, as follows:
  2771.  
  2772.            *=program.exe
  2773.  
  2774.         where an asterisk is used instead of a file extension.  Then, if
  2775.         you try to run a data file whose extension is not specified in
  2776.         [Extensions], WIL will run "program.exe."  Even though the
  2777.         customary ^.ext is not included in the example line above, WIL will
  2778.         pass the name of the data file as a command-line parameter to
  2779.         "program.exe."
  2780.  
  2781.         Note: WIL does not use the Windows registration database to match
  2782.         data files with their associated programs.
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.          ________________________________________________________________
  2790.                                                                        43
  2791.  
  2792.  
  2793.          ________________________________________________________________
  2794.  
  2795.  
  2796.  
  2797.  
  2798.         Partial window names
  2799.         Those WIL functions which take a partial windowname as a parameter
  2800.         can be directed to accept only an exact match, by ending the window
  2801.         name with a tilde (~).  For example, WinShow("Note~") would only
  2802.         match a window whose title was "Note"; it would not match
  2803.         "Notepad".
  2804.  
  2805.  
  2806.  
  2807.  
  2808.         Sounds
  2809.         If you have Windows Multimedia extensions, and hardware capable of
  2810.         playing WAV waveform files, there will be sounds audible at various
  2811.         points in the execution of WIL programs.  By default, these sounds
  2812.         are enabled.  If you want sounds to be off by default, enter the
  2813.         line:
  2814.  
  2815.              Sounds=Off
  2816.  
  2817.         in the [Main] section of the WWWBATCH.INI file.
  2818.  
  2819.         You can also use the Sounds function to turn sounds on and off from
  2820.         within a WIL program.
  2821.  
  2822.         If you add to the [Sounds] section of your WIN.INI file a line such
  2823.         as:
  2824.  
  2825.            StartProgram=CHIMES.WAV,Program Launch
  2826.  
  2827.         then the WIL Interpreter will make sounds whenever a new program is
  2828.         launched.
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.          ________________________________________________________________
  2848.                                                                        44
  2849.  
  2850.                                                              WIL LANGUAGE
  2851.          ________________________________________________________________
  2852.  
  2853.  
  2854.                                     WIL LANGUAGE
  2855.  
  2856.  
  2857.  
  2858.  
  2859.         Menu Structure {*M}
  2860.         Menus are defined in a menu file.  Each menu file consists of one
  2861.         or more lines of menu statements.  Each line is terminated with a
  2862.         carriage return / line feed (CRLF) combination, and can be up to
  2863.         255 characters long.
  2864.  
  2865.         There are two main parts of a menu file:
  2866.  
  2867.         The first section, which is optional, is the initialization code.
  2868.         This section is executed once when the menu is first loaded and
  2869.         run.  It's located before the first menu item declaration.
  2870.  
  2871.         The remainder of the menu file consists of menu item titles and
  2872.         their associated statements.  The code under each menu title is
  2873.         executed when the corresponding menu item is selected.  Execution
  2874.         begins at the first statement under a menu item and continues up to
  2875.         the definition of the next item.
  2876.  
  2877.  
  2878.  
  2879.  
  2880.         Menu Items {*M}
  2881.         Menu titles can consist of letters, digits, spaces, punctuation
  2882.         marks  ---
  2883.         can create.
  2884.  
  2885.         There are special characters you can use to modify the appearance
  2886.         of items in the menus.
  2887.  
  2888.         &    Causes the following character to be underlined in the menu
  2889.         item.  The user can select the item by pressing the ALT key with
  2890.         the character instead of using the mouse.
  2891.  
  2892.         |  In a main menu, puts this item on a new line.
  2893.         |  In a dropdown menu, this item starts a new column.
  2894.         _  Used to create a horizontal bar (in dropdown menus only).
  2895.  
  2896.         @  Causes the item not to be displayed in the menu.
  2897.  
  2898.         In order to identify a menu item within a WIL statement, each menu
  2899.         item you define has an associated menu name.  The menu name is
  2900.         built using only the letters and digits that make up the menu
  2901.         title.  Menu names are case-insensitive; you don't have to worry
  2902.         about how the actual menu title is capitalized in order to identify
  2903.         it.
  2904.  
  2905.          ________________________________________________________________
  2906.                                                                        45
  2907.  
  2908.                                                              WIL LANGUAGE
  2909.          ________________________________________________________________
  2910.  
  2911.         For menu items in a popup menu, the menu name consists of its
  2912.         parent menu's name, plus the popup menu item's name concatenated at
  2913.         the end.
  2914.  
  2915.         These menu names are valid as soon as the menu file is loaded, so
  2916.         you can use the menu management functions in the initialization
  2917.         code before the menus even appear.
  2918.  
  2919.         Top-level menu names must begin in column 1.  Submenu names are
  2920.         optional, and if used must begin in column 2-4; each column of
  2921.         indentation represents an additional level of submenu nesting.
  2922.         Actual menu code must begin in column 5 or higher, and must appear
  2923.         directly under the menu name to which it belongs.
  2924.  
  2925.         Example:
  2926.              PW=AskLine ("","Enter your password:", "")
  2927.              ;assuming the resident guru's pw is already in WIN.INI:
  2928.              RealPW = IniRead ("Our Company", "Tech Guru PW", "")
  2929.              Terminate (PW==RealPW, "Access", "You have FULL access")
  2930.  
  2931.              MenuChange("SystemUtilitiesCleanupDir",  @DISABLE)
  2932.              MenuChange("SystemUtilitiesEditBatFiles",@DISABLE)
  2933.              MenuChange("SystemUtilitiesEditWinIni",  @DISABLE)
  2934.              Message ("Access", "You have LIMITED access")
  2935.  
  2936.          &System Utilities  ;name = "SystemUtilities"
  2937.           &Cleanup Dir      ;name = "SystemUtilitiesCleanupDir"
  2938.              ...
  2939.           &Edit BAT Files...;name = "SystemUtilitiesEditBatFiles"
  2940.              ...
  2941.           &Edit WIN.INI     ;name = "SystemUtilitiesEditWinIni"
  2942.              ...
  2943.  
  2944.  
  2945.  
  2946.         Language Components
  2947.         WIL statements are constructed from constants, variables,
  2948.         operators, functions, commands, and comments.
  2949.  
  2950.         Each line in a WIL program can be up to 255 characters long.
  2951.  
  2952.  
  2953.  
  2954.  
  2955.         Constants
  2956.         The programming language supports both integer and string
  2957.         constants.
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.          ________________________________________________________________
  2964.                                                                        46
  2965.  
  2966.                                                              WIL LANGUAGE
  2967.          ________________________________________________________________
  2968.  
  2969.  
  2970.         Integer Constants
  2971.         Integer constants are built from the digits 0 through 9.  They can
  2972.         range in magnitude from negative to positive 231 - 1 (approximately
  2973.         two billion).  Constants larger than these permissible magnitudes
  2974.         will produce unpredictable results.
  2975.  
  2976.         Examples of integer constants:
  2977.  
  2978.          1
  2979.          -45
  2980.          377849
  2981.          -1999999999
  2982.  
  2983.         String Constants
  2984.         String constants are comprised of displayable characters bounded by
  2985.         quote marks.  You can use double quotes ("), single quotes ('), or
  2986.         back quotes (`) to enclose a string constant, as long as the same
  2987.         type of quote is used to both start and end it.  If you need to
  2988.         embed the delimiting quote mark inside the string constant, use the
  2989.         delimiting quote mark twice.
  2990.  
  2991.         Examples of string constants:
  2992.  
  2993.          "a"
  2994.          `Betty Boop`
  2995.          "This constant has an embedded "" mark"
  2996.          'This constant also has an embedded " mark'
  2997.  
  2998.         Predefined Constants
  2999.         The programming language has a number of built-in integer constants
  3000.         that can be used for various purposes.  These start with the @-
  3001.         sign, and are case-insensitive (although we prefer to use ALL
  3002.         CAPS).
  3003.  
  3004.         Some predefined constants:
  3005.  
  3006.            @FALSE                             @TILE
  3007.            @NO                                @TRUE
  3008.            @STACK                             @YES
  3009.  
  3010.  
  3011.  
  3012.         A list of all the predefined constants can be found in Appendix A
  3013.         on page 280.
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.          ________________________________________________________________
  3022.                                                                        47
  3023.  
  3024.                                                              WIL LANGUAGE
  3025.          ________________________________________________________________
  3026.  
  3027.  
  3028.  
  3029.  
  3030.         Identifiers
  3031.         Identifiers are the names supplied for variables, functions, and
  3032.         commands in your program.
  3033.  
  3034.         An identifier is a sequence of one or more letters or digits that
  3035.         begins with a letter.  Identifiers may have up to 30 characters.
  3036.  
  3037.         All identifiers are case insensitive.  Upper-case and lower-case
  3038.         characters may be mixed at will inside variable names, commands or
  3039.         functions.
  3040.  
  3041.         For example, these statements all mean the same thing:
  3042.  
  3043.          AskLine(MyTitle, Prompt, Default)
  3044.          ASKLINE(MYTITLE, PROMPT, DEFAULT)
  3045.          aSkLiNe(MyTiTlE, pRoMpT, dEfAuLt)
  3046.  
  3047.  
  3048.  
  3049.         Variables
  3050.         A variable may contain an integer, a string, a list, or a string
  3051.         representing an integer.  Automatic conversions between integers
  3052.         and strings are performed as a matter of course during execution.
  3053.  
  3054.         If a function requires a string parameter and an integer parameter
  3055.         is supplied, the variable will be automatically modified to include
  3056.         the representative string.
  3057.  
  3058.         If a function requires an integer parameter and a string parameter
  3059.         is supplied, an attempt will be made to convert the string to an
  3060.         integer.  If it does not convert successfully, an error will
  3061.         result.
  3062.  
  3063.  
  3064.  
  3065.  
  3066.         Lists
  3067.         A list is a string variable which itself contains one or more
  3068.         strings, each of which is delimited (separated) by a common
  3069.         character.  For example, the FileItemize function returns a list of
  3070.         file names, delimited by spaces, and the WinItemize function
  3071.         returns a list of window names, delimited by tabs.  In order to use
  3072.         functions which accept a list as a parameter, such as ItemSelect,
  3073.         you will need to know what character is being used to delimit your
  3074.         list.
  3075.  
  3076.  
  3077.  
  3078.  
  3079.          ________________________________________________________________
  3080.                                                                        48
  3081.  
  3082.                                                              WIL LANGUAGE
  3083.          ________________________________________________________________
  3084.  
  3085.  
  3086.  
  3087.  
  3088.         Keywords
  3089.         Keywords are the predefined identifiers that have special meaning
  3090.         to the programming language.  These cannot be used as variable
  3091.         names.
  3092.  
  3093.         WIL keywords consist of the functions, commands, and predefined
  3094.         constants.
  3095.  
  3096.         Some examples of reserved keywords:
  3097.  
  3098.            Beep
  3099.            DirChange
  3100.            @Yes
  3101.            FileCopy
  3102.  
  3103.  
  3104.  
  3105.         Operators
  3106.         The programming language operators take one operand ("unary
  3107.         operators") or two operands ("binary operators").
  3108.  
  3109.         Unary operators (integers only):
  3110.            -           Arithmetic Negation (Two's complement)
  3111.            +           Identity (Unary plus)
  3112.            ~           Bitwise Not.  Changes each 0 bit to 1, and
  3113.                        vice-versa.
  3114.            !           Logical Not.  Produces 0 (@FALSE) if the operand is
  3115.                        nonzero, else 1 (@TRUE) if the operand is zero.
  3116.  
  3117.         Binary arithmetic operators (integers only):
  3118.            *           Multiplication
  3119.            /           Division
  3120.            mod         Modulo
  3121.            +           Addition
  3122.            -           Subtraction
  3123.            <<          Left Shift
  3124.            >>          Right Shift
  3125.            &           Bitwise And
  3126.            |           Bitwise Or
  3127.            ^           Bitwise Exclusive Or  (XOR)
  3128.            &&          Logical And
  3129.            ||          Logical Or
  3130.  
  3131.  
  3132.         Binary relational operators (integers and strings):
  3133.            >           Greater-than
  3134.            >=          Greater-than or equal
  3135.            <           Less-than
  3136.  
  3137.          ________________________________________________________________
  3138.                                                                        49
  3139.  
  3140.                                                              WIL LANGUAGE
  3141.          ________________________________________________________________
  3142.  
  3143.            <=          Less-than or equal
  3144.            ==          Equality
  3145.            != or <>    Inequality
  3146.  
  3147.         Assignment operator (integers and strings):
  3148.            =      Assigns evaluated result of an expression to a variable
  3149.  
  3150.  
  3151.  
  3152.  
  3153.         Precedence and evaluation order
  3154.         The precedence of the operators affect the evaluation of operands
  3155.         in expressions.  Operands associated with higher-precedence
  3156.         operators are evaluated before the lower-precedence operators.
  3157.  
  3158.         The table below shows the precedence of the operators.  Where
  3159.         operators have the same precedence, they are evaluated from left to
  3160.         right.
  3161.  
  3162.         Operator                 Description
  3163.            ( )                   Parenthetical grouping
  3164.            ~ ! - +               Unary operators
  3165.            * / mod               Multiplication & Division
  3166.            + -                   Addition & Subtraction
  3167.            <<  >>                Shift operators
  3168.            < <= == >= > != <>    Relational operators
  3169.            & ^ |                 Bit manipulation operators
  3170.            && ||                 Logical operators
  3171.  
  3172.  
  3173.  
  3174.         Comments
  3175.         A comment is a sequence of characters that are ignored when
  3176.         processing a command.  A semicolon (not otherwise part of a string
  3177.         constant) indicates the beginning of a comment.
  3178.  
  3179.         All characters to the right of the semicolon are considered
  3180.         comments, and are ignored.
  3181.  
  3182.         Blank lines are also ignored.
  3183.  
  3184.         Examples of comments:
  3185.          ; This is a comment
  3186.          abc = 5  ; This is also a comment
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.          ________________________________________________________________
  3196.                                                                        50
  3197.  
  3198.                                                              WIL LANGUAGE
  3199.          ________________________________________________________________
  3200.  
  3201.  
  3202.  
  3203.  
  3204.         Statements
  3205.  
  3206.         Assignment Statements
  3207.         Assignment statements are used to set variables to specific or
  3208.         computed values.  Variables may be set to integers or strings.
  3209.  
  3210.         Examples:
  3211.          a = 5
  3212.          value = Average(a, 10, 15)
  3213.          location = "Northern Hemisphere"
  3214.          world = StrCat(location, " ", "Southern Hemisphere")
  3215.  
  3216.         Control Statements
  3217.         Control statements are generally used to execute system management
  3218.         functions and consist of a call to a command without assigning any
  3219.         return values.
  3220.  
  3221.         Examples:
  3222.          Exit
  3223.          Yield
  3224.  
  3225.  
  3226.  
  3227.         Substitution
  3228.         The WIL language has a powerful substitution feature which inserts
  3229.         the contents of a string variable into a statement before the line
  3230.         is parsed.
  3231.  
  3232.         To substitute the contents of a variable in the statement, simply
  3233.         put a percent-sign (%) on both sides of the variable name.
  3234.  
  3235.         Examples:
  3236.          mycmd = "DirChange('c:\')"   ;set mycmd to a command
  3237.          %mycmd%                      ;execute the command
  3238.  
  3239.         Or consider this one:
  3240.  
  3241.          IniWrite("PC", "User", "Richard")
  3242.          ...
  3243.          name = IniRead("PC", "User", "somebody")
  3244.          message("", "Thank you, %name%")
  3245.  
  3246.         will produce this message box:
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.          ________________________________________________________________
  3254.                                                                        51
  3255.  
  3256.                                                              WIL LANGUAGE
  3257.          ________________________________________________________________
  3258.  
  3259.               ..........................
  3260.               .                        .
  3261.               ..........................
  3262.               .                        .
  3263.               .   Thank you, Richard   .
  3264.               .                        .
  3265.               .          [OK]          .
  3266.               ..........................
  3267.  
  3268.         The variable substitution feature can be used to simulate an
  3269.         "array" of strings.  For example, if you wanted to read the lines
  3270.         contained in a file into an array of variables named line1 through
  3271.         line# (where # is the line number of the last line in the file),
  3272.         and then write them to a new file in reverse order, you could do so
  3273.         as follows:
  3274.  
  3275.          handle = FileOpen("c:\config.sys", "READ")
  3276.          num = 0
  3277.          :readnext
  3278.          num = num + 1
  3279.          line%num% = FileRead(handle)
  3280.          If line%num% != "*EOF*" Then Goto readnext
  3281.          FileClose(handle)
  3282.          handle = FileOpen("c:\config.rev", "WRITE")
  3283.          :writenext
  3284.          num = num - 1
  3285.          FileWrite(handle, line%num%)
  3286.          If num > 1 Then Goto writenext
  3287.          FileClose(handle)
  3288.          Message("Processing complete", "CONFIG.REV created")
  3289.  
  3290.  
  3291.         To put a single percent-sign (%) on a source line, specify a double
  3292.         percent sign(%%).  This is required even inside quoted strings.
  3293.  
  3294.         Note:  The length of a line, after any substitution occurs, may not
  3295.         exceed 255 characters.
  3296.  
  3297.  
  3298.  
  3299.  
  3300.         Function Parameters
  3301.         Most of the functions and commands in the language require
  3302.         parameters.  These come in several types:
  3303.  
  3304.            Integer
  3305.            String
  3306.            List
  3307.            Variable name
  3308.  
  3309.  
  3310.  
  3311.          ________________________________________________________________
  3312.                                                                        52
  3313.  
  3314.                                                              WIL LANGUAGE
  3315.          ________________________________________________________________
  3316.  
  3317.         The interpreter performs automatic conversions between strings and
  3318.         integers, so in general you can use them interchangeably.
  3319.  
  3320.         Integer parameters may be any of the following:
  3321.  
  3322.            An integer (i.e. 23)
  3323.            A string representing an integer (i.e. "23")
  3324.            A variable containing an integer
  3325.            A variable containing a string representing an integer
  3326.  
  3327.  
  3328.         String parameters may be any of the following:
  3329.  
  3330.            A string
  3331.            An integer
  3332.            A variable containing a string
  3333.            A variable containing a list
  3334.            A variable containing an integer
  3335.  
  3336.  
  3337.  
  3338.  
  3339.         Error Handling
  3340.         There are three types of errors that can occur while processing a
  3341.         WIL program:  Minor, Moderate, and Fatal.  What happens when an
  3342.         error occurs depends on the current error mode, which is set with
  3343.         the ErrorMode function.
  3344.  
  3345.         There are three possible modes you can specify:
  3346.  
  3347.         @CANCEL
  3348.            User is notified when any error occurs, and then the WIL program
  3349.            is canceled.  This is the default.
  3350.  
  3351.         @NOTIFY
  3352.            User is notified when any error occurs, and has option to
  3353.            continue unless the error is fatal.
  3354.  
  3355.         @OFF
  3356.            User is only notified if the error is moderate or fatal.  User
  3357.            has option to continue unless the error is fatal.
  3358.  
  3359.         The function LastError returns the code of the most-recent error
  3360.         encountered during the currently-executing WIL program.
  3361.  
  3362.         Minor errors are numbered from    1000 to 1999.
  3363.         Moderate errors are numbered from 2000 to 2999.
  3364.         Fatal errors are numbered from    3000 to 3999.
  3365.  
  3366.         Error handling is reset to @CANCEL at the start of each WIL
  3367.         program.
  3368.  
  3369.          ________________________________________________________________
  3370.                                                                        53
  3371.  
  3372.                                                              WIL LANGUAGE
  3373.          ________________________________________________________________
  3374.  
  3375.  
  3376.  
  3377.  
  3378.         The Functions & Statements
  3379.  
  3380.  
  3381.  
  3382.         Inputting Information
  3383.         AskLine (title, prompt, default)
  3384.            Lets user enter a line of information.
  3385.  
  3386.         AskPassword (title, prompt)
  3387.            Prompts the user for a password.
  3388.  
  3389.         AskYesNo (title, question)
  3390.            Lets user choose from Yes, No, or Cancel.
  3391.  
  3392.         ItemSelect (title, list, delimiter)
  3393.            Chooses an item from a listbox.
  3394.  
  3395.         TextBox (title, filename)
  3396.            Fills a listbox with text strings from a file.
  3397.  
  3398.         TextBoxSort (title, filename)
  3399.            Fills a sorted listbox with text strings from a file.
  3400.  
  3401.         TextSelect (title, list, delimiter)
  3402.            Allows the user to choose an item from an unsorted listbox.
  3403.  
  3404.  
  3405.  
  3406.  
  3407.         Displaying Information
  3408.         Beep
  3409.            Beeps at the user.
  3410.  
  3411.         Dialog (dialog-name)
  3412.            Displays a user-defined dialog box.
  3413.  
  3414.         DialogBox (title, WDG file)
  3415.            Pops up a Windows dialog box defined by the WDG template file.
  3416.  
  3417.         Display (seconds, title, text)
  3418.            Momentarily displays a string.
  3419.  
  3420.         Message (title, text)
  3421.            Displays text in a message box.
  3422.  
  3423.         Pause (title, text)
  3424.            Displays text in a message box.
  3425.  
  3426.  
  3427.          ________________________________________________________________
  3428.                                                                        54
  3429.  
  3430.                                                              WIL LANGUAGE
  3431.          ________________________________________________________________
  3432.  
  3433.         TextBox (title, filename)
  3434.            Fills a listbox with text strings from a file.
  3435.  
  3436.         TextBoxSort (title, filename)
  3437.            Fills a sorted listbox with text strings from a file.
  3438.  
  3439.         TextSelect (title, list, delimiter)
  3440.            Allows the user to choose an item from an unsorted listbox.
  3441.  
  3442.  
  3443.  
  3444.  
  3445.         File Management
  3446.         FileAppend (from-list, to-file)
  3447.            Appends one or more files to another file.
  3448.  
  3449.         FileAttrGet (filename)
  3450.            Returns file attributes.
  3451.  
  3452.         FileAttrSet (file-list, settings)
  3453.            Sets file attributes.
  3454.  
  3455.         FileClose (filehandle)
  3456.            Closes a file.
  3457.  
  3458.         FileCopy (from-list, to-file, warning)
  3459.            Copies files.
  3460.  
  3461.         FileDelete (file-list)
  3462.            Deletes files.
  3463.  
  3464.         FileExist (filename)
  3465.            Determines if a file exists.
  3466.  
  3467.         FileExtension (filename)
  3468.            Returns extension of file.
  3469.  
  3470.         FileItemize (file-list)
  3471.            Builds a list of files.
  3472.  
  3473.         FileLocate (filename)
  3474.            Finds a file within the current DOS path.
  3475.  
  3476.         FileMove (from-list, to-file, warning)
  3477.            Moves files to another set of pathnames.
  3478.  
  3479.         FileOpen (filename, open-type)
  3480.            Opens a STANDARD ASCII (only) file for reading or writing.
  3481.  
  3482.         FilePath (filename)
  3483.            Returns path of file.
  3484.  
  3485.          ________________________________________________________________
  3486.                                                                        55
  3487.  
  3488.                                                              WIL LANGUAGE
  3489.          ________________________________________________________________
  3490.  
  3491.         FileRead (filehandle)
  3492.            Reads data from a file.
  3493.  
  3494.         FileRename (from-list, to-file)
  3495.            Renames files to another set of names.
  3496.  
  3497.         FileRoot (filename)
  3498.            Returns root of file.
  3499.  
  3500.         FileSize (file-list)
  3501.            Adds up the total size of a set of files.
  3502.  
  3503.         FileTimeGet (filename)
  3504.            Returns file date and time.
  3505.  
  3506.         FileTimeTouch (file-list)
  3507.            Sets file(s) to current time.
  3508.  
  3509.         FileWrite (filehandle,output-data)
  3510.            Writes data to a file.
  3511.  
  3512.         IniDelete (section, keyname)
  3513.            Removes a line or section from WIN.INI.
  3514.  
  3515.         IniDeletePvt (section, keyname, filename)
  3516.            Removes a line or section from a private INI file.
  3517.  
  3518.         IniItemize (section)
  3519.            Lists keywords or sections in WIN.INI.
  3520.  
  3521.         IniItemizePvt (section, filename)
  3522.            Lists keywords or sections in a private INI file.
  3523.  
  3524.         IniRead (section, keyname, default)
  3525.            Reads a string from the WIN.INI file.
  3526.  
  3527.         IniReadPvt (section, keyname, default, filename)
  3528.            Reads a string from a private INI file.
  3529.  
  3530.         IniWrite (section, keyname, string)
  3531.            Writes a string to the WIN.INI file.
  3532.  
  3533.         IniWritePvt (section, keyname, data, filename)
  3534.            Writes a string to a private INI file.
  3535.  
  3536.  
  3537.  
  3538.  
  3539.         Directory Management
  3540.         DirChange ([d:]path)
  3541.            Changes the current directory.
  3542.  
  3543.          ________________________________________________________________
  3544.                                                                        56
  3545.  
  3546.                                                              WIL LANGUAGE
  3547.          ________________________________________________________________
  3548.  
  3549.         DirGet ( )
  3550.            Returns the current directory path.
  3551.  
  3552.         DirHome ( )
  3553.            Returns the initial directory path.
  3554.  
  3555.         DirItemize (dir-list)
  3556.            Builds a list of directories.
  3557.  
  3558.         DirMake ([d:]path)
  3559.            Creates a new directory.
  3560.  
  3561.         DirRemove ([d:]path)
  3562.            Removes an existing directory.
  3563.  
  3564.         DirRename ([d:]oldpath, [d:]newpath)
  3565.            Renames a directory.
  3566.  
  3567.         DirWindows (request#)
  3568.            Returns the name of the Windows or Windows System directory.
  3569.  
  3570.  
  3571.  
  3572.  
  3573.         Disk Drive Management
  3574.         DiskFree (drive-list)
  3575.            Returns the amount of free space on a set of drives.
  3576.  
  3577.         DiskScan (request#)
  3578.            Returns list of drives.
  3579.  
  3580.         LogDisk (drive)
  3581.            Changes the logged disk drive.
  3582.  
  3583.  
  3584.  
  3585.  
  3586.         Window Management
  3587.         AppExist (program-name)
  3588.            Tells if an application is running.
  3589.  
  3590.         AppWaitClose (program-name)
  3591.            Suspends WIL program execution until a specified application has
  3592.            been closed.
  3593.  
  3594.         IconArrange ( )
  3595.            Rearranges icons.
  3596.  
  3597.         WinActivate (partial-winname)
  3598.            Makes an application window the active window.
  3599.  
  3600.  
  3601.          ________________________________________________________________
  3602.                                                                        57
  3603.  
  3604.                                                              WIL LANGUAGE
  3605.          ________________________________________________________________
  3606.  
  3607.         WinArrange (style)
  3608.            Arranges all running application windows on the screen.
  3609.  
  3610.         WinClose (partial-winname)
  3611.            Closes an application window.
  3612.  
  3613.         WinCloseNot (partial-winname [, partial-winname...])
  3614.            Closes all application windows except those specified.
  3615.  
  3616.         WinExeName (partial-winname)
  3617.            Returns the name of the executable file which created a
  3618.            specified window.
  3619.  
  3620.         WinExist (partial-winname)
  3621.            Tells if window exists.
  3622.  
  3623.         WinGetActive ( )
  3624.            Gets the title of the active window.
  3625.  
  3626.         WinHide (partial-winname)
  3627.            Hides an application window.
  3628.  
  3629.         WinIconize (partial-winname)
  3630.            Turns an application window into an icon.
  3631.  
  3632.         WinItemize ( )
  3633.            Lists all the main windows currently running.
  3634.  
  3635.         WinName ( )
  3636.            Returns the name of the window calling the WIL Interpreter.
  3637.  
  3638.         WinPlace (x-ul, y-ul, x-br, y-br, partial-winname)
  3639.            Changes the size and position of an application window on the
  3640.            screen.
  3641.  
  3642.         WinPlaceGet (win-type, partial-winname)
  3643.            Returns window coordinates.
  3644.  
  3645.         WinPlaceSet (win-type, partial-winname, position-string)
  3646.            Sets window coordinates.
  3647.  
  3648.         WinPosition (partial-winname)
  3649.            Returns window position.
  3650.  
  3651.         WinShow (partial-winname)
  3652.            Shows a currently-hidden application window.
  3653.  
  3654.         WinState (partial-winname)
  3655.            Returns the current state of a window.
  3656.  
  3657.  
  3658.  
  3659.          ________________________________________________________________
  3660.                                                                        58
  3661.  
  3662.                                                              WIL LANGUAGE
  3663.          ________________________________________________________________
  3664.  
  3665.         WinTitle (partial-winname, new-winname)
  3666.            Changes the title of an application window.
  3667.  
  3668.         WinWaitClose (partial-winname)
  3669.            Waits until an application window is closed.
  3670.  
  3671.         WinZoom (partial-winname)
  3672.            Maximizes an application window to full-screen.
  3673.  
  3674.  
  3675.  
  3676.  
  3677.         Program Management
  3678.         Run (program-name, parameters)
  3679.            Runs a program as a normal window.
  3680.  
  3681.         RunHide (program-name, parameters)
  3682.            Runs a program in a hidden window.
  3683.  
  3684.         RunHideWait (program-name, parameters)
  3685.            Runs a program in a hidden window, and waits for it to close.
  3686.  
  3687.         RunIcon (program-name, parameters)
  3688.            Runs a program as an icon.
  3689.  
  3690.         RunIconWait (program-name, parameters)
  3691.            Runs a program as an icon, and waits for it to close.
  3692.  
  3693.         RunWait (program-name, parameters)
  3694.            Runs a program as a normal window, and waits for it to close.
  3695.  
  3696.         RunZoom (program-name, parameters)
  3697.            Runs a program in a maximized window.
  3698.  
  3699.         RunZoomWait (program-name, parameters)
  3700.            Runs a program in a maximized window, and waits for it to close.
  3701.  
  3702.  
  3703.  
  3704.  
  3705.         String Handling
  3706.         Char2Num (string)
  3707.            Returns the ANSI code of a string's first character.
  3708.  
  3709.         IsNumber (string)
  3710.            Determines if a string represents a valid number.
  3711.  
  3712.         ItemCount (list, delimiter)
  3713.            Returns the number of items in a list.
  3714.  
  3715.  
  3716.  
  3717.          ________________________________________________________________
  3718.                                                                        59
  3719.  
  3720.                                                              WIL LANGUAGE
  3721.          ________________________________________________________________
  3722.  
  3723.         ItemExtract (select, list, delimiter)
  3724.            Returns the selected item from a list.
  3725.  
  3726.         ItemInsert (item, index, list, delimiter)
  3727.            Adds an item to a list.
  3728.  
  3729.         ItemLocate (item, list, delimiter)
  3730.            Returns the position of an item in a list.
  3731.  
  3732.         ItemRemove (index, list, delimiter)
  3733.            Removes an item from a list.
  3734.  
  3735.         ItemSort (list, delimiter)
  3736.            Sorts a list.
  3737.  
  3738.         Num2Char (number)
  3739.            Converts a number to the ANSI character it represents.
  3740.  
  3741.         ParseData (string)
  3742.            Parses the passed string, just like passed parameters
  3743.            are parsed.
  3744.  
  3745.         StrCat (string[, string...])
  3746.            Concatenates strings together.
  3747.  
  3748.         StrCmp (string1, string2)
  3749.            Compares two strings.
  3750.  
  3751.         StrFill (string, string-length)
  3752.            Builds a string from a repeated smaller string.
  3753.  
  3754.         StrFix (base-string, padding-string, length)
  3755.            Pads or truncates a string to a fixed length.
  3756.  
  3757.         StriCmp (string1, string2)
  3758.            Compares two strings, ignoring their case.
  3759.  
  3760.         StrIndex (main-str, sub-str, start, direction)
  3761.            Locates a string within a larger string.
  3762.  
  3763.         StrLen (string)
  3764.            Returns the length of a string
  3765.  
  3766.         StrLower (string)
  3767.            Converts a string to all lower-case characters.
  3768.  
  3769.         StrReplace (string, old, new)
  3770.            Replaces all occurances of a substring with another.
  3771.  
  3772.         StrScan (main-str, delims, start, direction)
  3773.            Finds an occurrence of one or more delimiter characters in a
  3774.            string.
  3775.          ________________________________________________________________
  3776.                                                                        60
  3777.  
  3778.                                                              WIL LANGUAGE
  3779.          ________________________________________________________________
  3780.  
  3781.         StrSub (string, start, length)
  3782.            Returns a substring from within a string.
  3783.  
  3784.         StrTrim (string)
  3785.            Trims leading and trailing blanks from a string.
  3786.  
  3787.         StrUpper (string)
  3788.            Converts a string to all upper-case characters.
  3789.  
  3790.  
  3791.  
  3792.  
  3793.         Arithmetic Functions
  3794.         Abs (number)
  3795.            Returns the absolute value of a number.
  3796.  
  3797.         Average (num [, num...])
  3798.            Returns the average of a list of numbers.
  3799.  
  3800.         Max (num [, num...])
  3801.            Determines the highest number in a list.
  3802.  
  3803.         Min (num [, num...])
  3804.            Determines the lowest number in a list.
  3805.  
  3806.         Random (max)
  3807.            Generates a positive random number.
  3808.  
  3809.  
  3810.  
  3811.  
  3812.         Clipboard Handling
  3813.         ClipAppend (string)
  3814.            Appends a string to the end of the Clipboard.
  3815.  
  3816.         ClipGet ( )
  3817.            Returns the Clipboard contents into a string.
  3818.  
  3819.         ClipPut (string)
  3820.            Replaces the Clipboard contents with a string.
  3821.  
  3822.  
  3823.  
  3824.  
  3825.         Process Control
  3826.         Call (filename, parameters)
  3827.            Calls a WIL batch file as a subroutine.
  3828.  
  3829.         Debug (mode)
  3830.            Turns Debug mode on or off.
  3831.  
  3832.  
  3833.          ________________________________________________________________
  3834.                                                                        61
  3835.  
  3836.                                                              WIL LANGUAGE
  3837.          ________________________________________________________________
  3838.  
  3839.         Delay (seconds)
  3840.            Pauses WIL program execution.
  3841.  
  3842.         Drop (var [, var...])
  3843.            Deletes variables to recover their memory.
  3844.  
  3845.         Else statement
  3846.            Continues a previous If statement.
  3847.  
  3848.         EndSession ( )
  3849.            Ends the current Windows session.
  3850.  
  3851.         ErrorMode (mode)
  3852.            Sets what happens in the event of an error.
  3853.  
  3854.         Exclusive (mode)
  3855.            Controls whether or not other Windows program will get any time
  3856.            to execute.
  3857.  
  3858.         Execute statement
  3859.            Directly executes a WIL statement.
  3860.  
  3861.         Exit
  3862.            Unconditionally ends a WIL program.
  3863.  
  3864.         Goto label
  3865.            Changes the flow of control in a WIL program.
  3866.  
  3867.         If condition Then statement
  3868.            Conditionally performs a function.
  3869.  
  3870.         IgnoreInput (mode)
  3871.            Turns off hardware input to windows.
  3872.  
  3873.         IsDefined (variable)
  3874.            Determines if a variable is currently defined.
  3875.  
  3876.         IsKeyDown (key-codes)
  3877.            Tells about keys/mouse.
  3878.  
  3879.         LastError ( )
  3880.            Returns the last error encountered.
  3881.  
  3882.         Return
  3883.            Returns from a Call to the calling program.
  3884.  
  3885.         SKDebug (mode)
  3886.            Controls how SendKey works
  3887.  
  3888.         Terminate
  3889.            Conditionally ends a WIL program.
  3890.  
  3891.          ________________________________________________________________
  3892.                                                                        62
  3893.  
  3894.                                                              WIL LANGUAGE
  3895.          ________________________________________________________________
  3896.  
  3897.         Then statement
  3898.            Continues a previous If statement.
  3899.  
  3900.         WaitForKey
  3901.            Waits for a specific key to be pressed.
  3902.  
  3903.         Yield
  3904.            Pauses WIL processing so other applications can process some
  3905.            messages.
  3906.  
  3907.  
  3908.  
  3909.  
  3910.         Miscellaneous Functions
  3911.         ButtonNames (OK-name, Cancel-name)
  3912.            Changes the names of the buttons which appear in WIL dialogs.
  3913.  
  3914.         IntControl (request#, p1, p2, p3, p4)
  3915.            Internal control functions.
  3916.  
  3917.         Reload ( )
  3918.            Reloads menu file(s).
  3919.  
  3920.         SendKey (character-codes)
  3921.            Sends keystrokes to the active application.
  3922.  
  3923.         SnapShot (request#)
  3924.            Takes a snapshot of the screen and pastes it to the clipboard.
  3925.  
  3926.         WallPaper (bmp-name, tile)
  3927.            Changes the Windows wallpaper.
  3928.  
  3929.         WinParmSet (request#, new-value, ini-control)
  3930.            Sets system information.
  3931.  
  3932.         WinHelp (help-file, function, keyword)
  3933.            Calls a Windows help file.
  3934.  
  3935.  
  3936.  
  3937.  
  3938.         System Information
  3939.         DateTime ( )
  3940.            Returns the current date and time.
  3941.  
  3942.         DOSVersion (level)
  3943.            Returns the version numbers of the current version of DOS.
  3944.  
  3945.         Environment (env-variable)
  3946.            Returns the value of a DOS environment variable.
  3947.  
  3948.  
  3949.          ________________________________________________________________
  3950.                                                                        63
  3951.  
  3952.                                                              WIL LANGUAGE
  3953.          ________________________________________________________________
  3954.  
  3955.         IsLicensed ( )
  3956.            Tells if the calling application is licensed.
  3957.  
  3958.         MouseInfo (request#)
  3959.            Returns assorted mouse information.
  3960.  
  3961.         Version ( )
  3962.            Returns the version of the parent program currently running.
  3963.  
  3964.         VersionDLL ( )
  3965.            Returns the version of the WIL Interpreter currently running.
  3966.  
  3967.         WinConfig ( )
  3968.            Returns WIN3 mode flags.
  3969.  
  3970.         WinMetrics (request#)
  3971.            Returns Windows system information.
  3972.  
  3973.         WinParmGet (request#)
  3974.            Returns system information.
  3975.  
  3976.         WinParmSet (request#, new-value, ini-control)
  3977.            Sets system information.
  3978.  
  3979.         WinResources (request#)
  3980.            Returns information on available memory and resources.
  3981.  
  3982.         WinVersion (level)
  3983.            Returns the version of Windows that is currently running.
  3984.  
  3985.  
  3986.  
  3987.  
  3988.         DDE Functions
  3989.         DDEExecute (channel, command string)
  3990.            Sends commands to a DDE server application.
  3991.  
  3992.         DDEInitiate (app name, topic name)
  3993.            Opens a DDE channel.
  3994.  
  3995.         DDEPoke (channel, item name, item value)
  3996.            Sends data to a DDE server application.
  3997.  
  3998.         DDERequest (channel, item name)
  3999.            Gets data from a DDE server application.
  4000.  
  4001.         DDETerminate (channel)
  4002.            Closes a DDE channel.
  4003.  
  4004.         DDETimeout (value)
  4005.            Sets the DDE timeout value.
  4006.  
  4007.          ________________________________________________________________
  4008.                                                                        64
  4009.  
  4010.                                                              WIL LANGUAGE
  4011.          ________________________________________________________________
  4012.  
  4013.  
  4014.  
  4015.  
  4016.         Network Functions
  4017.         NetAddCon (net-path, password, local-name)
  4018.            Connects network resources to imaginary local disk drives or
  4019.            printer ports.
  4020.  
  4021.         NetAttach (server-name)
  4022.            Attaches to a network file server.
  4023.  
  4024.         NetBrowse (request#)
  4025.            Displays a network dialog box allowing the user to select a
  4026.            network resource.
  4027.  
  4028.         NetCancelCon (name, force)
  4029.            Breaks a network connection.
  4030.  
  4031.         NetDetach (server-name)
  4032.            Detaches from a network file server.
  4033.  
  4034.         NetDialog ( )
  4035.            Brings up the network driver's dialog box.
  4036.  
  4037.         NetGetCaps (request#)
  4038.            Returns information on network capabilities.
  4039.  
  4040.         NetGetCon (local-name)
  4041.            Returns the name of a connected network resource.
  4042.  
  4043.         NetGetUser ( )
  4044.            Returns the name of the user currently logged into the network.
  4045.  
  4046.         NetLogin(server-name, user-name, password)
  4047.            Performs a network login.
  4048.  
  4049.         NetLogout(server-name)
  4050.            Performs a network logout.
  4051.  
  4052.         NetMapRoot(local-name, net-path)
  4053.            Maps a local drive to a network resource.
  4054.  
  4055.         NetMemberGet(server-name, group-name)
  4056.            Determines whether the current user is a member of a specific
  4057.            group.
  4058.  
  4059.         NetMemberSet(server-name, group-name)
  4060.            Sets the current user as a member of a group.
  4061.  
  4062.         NetMsgAll(server-name, message)
  4063.            Broadcasts a message to all users on the network.
  4064.  
  4065.          ________________________________________________________________
  4066.                                                                        65
  4067.  
  4068.  
  4069.          ________________________________________________________________
  4070.  
  4071.         NetMsgSend(server-name, user-name, message)
  4072.            Sends a message to a specific user on the network.
  4073.  
  4074.  
  4075.  
  4076.  
  4077.         Multimedia Functions
  4078.         PlayMedia (command-string)
  4079.            Controls multimedia devices.
  4080.  
  4081.         PlayMidi (filename, mode)
  4082.            Plays a MID or RMI sound file.
  4083.  
  4084.         PlayWaveForm (filename, mode)
  4085.            Plays a WAV sound file.
  4086.  
  4087.         Sounds (request#)
  4088.            Turns sounds on or off.
  4089.  
  4090.  
  4091.  
  4092.  
  4093.         Menu Management
  4094.         CurrentFile ( )
  4095.            Returns the selected filename.
  4096.  
  4097.         IsMenuChecked (menuname)
  4098.            Determines if a menu item has a checkmark next to it.
  4099.  
  4100.         IsMenuEnabled (menuname)
  4101.            Determines if a menu item has been enabled.
  4102.  
  4103.         MenuChange (menuname, flags)
  4104.            Checks, unchecks, enables, or disables a menu item.
  4105.  
  4106.  
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.          ________________________________________________________________
  4124.                                                                        66
  4125.  
  4126.                                                          WIL INTRODUCTION
  4127.          ________________________________________________________________
  4128.  
  4129.  
  4130.                                         WIL
  4131.                                       FUNCTION
  4132.                                      REFERENCE
  4133.  
  4134.  
  4135.  
  4136.  
  4137.         WIL Introduction
  4138.         The WIL programming language consists of a large number of
  4139.         functions and commands, which we describe in detail in this
  4140.         section.
  4141.  
  4142.         We use a shorthand notation to indicate the syntax of the
  4143.         functions.
  4144.  
  4145.         Function names and other actual characters you type are in
  4146.         boldface.  Optional parameters are enclosed in square brackets "[
  4147.         ]".  When a function takes a variable number of parameters, the
  4148.         variable parts will be followed by ellipses ("...").
  4149.  
  4150.         Take, for example, string concatenation:
  4151.  
  4152.         StrCat (string[, string...])
  4153.  
  4154.         This says that the StrCat function takes at least one string
  4155.         parameter.  Optionally, you can specify more strings to
  4156.         concatenate.  If you do, you must separate the strings with commas.
  4157.  
  4158.         For each function and command, we show you the Syntax, describe the
  4159.         Parameters (if any), the value it Returns (if any), a description
  4160.         of the function, Example code (shown in Courier type), and related
  4161.         functions you may want to See Also.
  4162.  
  4163.         Items marked {*M} are available only in menu script usages.
  4164.  
  4165.         (i) indicates an integer parameter or return value.
  4166.         (s) indicates a string parameter or return value.
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.          ________________________________________________________________
  4182.                                                                        67
  4183.  
  4184.                                                                       Abs
  4185.          ________________________________________________________________
  4186.  
  4187.  
  4188.  
  4189.  
  4190.         Abs
  4191.         Returns the absolute value of a number.
  4192.  
  4193.  
  4194.         Syntax:
  4195.          Abs (integer)
  4196.  
  4197.         Parameters:
  4198.          (i) integer  integer whose absolute value is desired.
  4199.  
  4200.         Returns:
  4201.          (i)          absolute value of integer.
  4202.  
  4203.         This function returns the absolute (positive) value of the integer
  4204.         which is passed to it, regardless of whether that integer is
  4205.         positive or negative.
  4206.  
  4207.  
  4208.         Example:
  4209.          dy = Abs(y1 - y2)
  4210.          Message("Years", "There are %dy% years 'twixt %y1% and %y2%")
  4211.  
  4212.  
  4213.         See Also:
  4214.            Average, IsNumber, Max, Min
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.          ________________________________________________________________
  4240.                                                                        68
  4241.  
  4242.                                                                  AppExist
  4243.          ________________________________________________________________
  4244.  
  4245.  
  4246.  
  4247.  
  4248.         AppExist
  4249.         Tells if an application is running.
  4250.  
  4251.  
  4252.         Syntax:
  4253.          AppExist (program-name)
  4254.  
  4255.         Parameters:
  4256.          (s) program-name   name of a Windows EXE or DLL file.
  4257.  
  4258.         Returns:
  4259.          (i)          @TRUE if the specified application is running;
  4260.                       @FALSE if the specified application is not running.
  4261.  
  4262.         Use this function to determine whether a specific Windows
  4263.         application is currently running.  Unlike WinExist, you can use
  4264.         AppExist without knowing the title of the application's window.
  4265.  
  4266.         "Program-name" is the name of a Windows EXE or DLL file, including
  4267.         the file extension (and, optionally, a full path to the file).
  4268.  
  4269.  
  4270.         Example:
  4271.          If AppExist("clock.exe") == @FALSE Then Run("clock.exe", "")
  4272.  
  4273.  
  4274.         See Also:
  4275.            AppWaitClose, Run, WinExeName, WinExist
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.          ________________________________________________________________
  4298.                                                                        69
  4299.  
  4300.                                                              AppWaitClose
  4301.          ________________________________________________________________
  4302.  
  4303.  
  4304.  
  4305.  
  4306.         AppWaitClose
  4307.         Suspends WIL program execution until a specified application has
  4308.         been closed.
  4309.  
  4310.  
  4311.         Syntax:
  4312.          AppWaitClose (program-name)
  4313.  
  4314.         Parameters:
  4315.          (s) program-name   name of a Windows EXE or DLL file.
  4316.  
  4317.         Returns:
  4318.          (i)          @TRUE if the specified application is running;
  4319.                       @FALSE if the specified application is not running.
  4320.  
  4321.         Use this function to suspend the WIL program's execution until the
  4322.         user has finished using a given application and has manually closed
  4323.         it.  Unlike WinWaitClose, you can use AppWaitClose without knowing
  4324.         the title of the application's window.
  4325.  
  4326.         "Program-name" is the name of a Windows EXE or DLL file, including
  4327.         the file extension (and, optionally, a full path to the file).
  4328.  
  4329.  
  4330.         Example:
  4331.          Run("clock.exe", "")
  4332.          Display(4, "Note", "Close Clock to continue")
  4333.          AppWaitClose("clock.exe")
  4334.          Message("Continuing...", "Clock closed")
  4335.  
  4336.  
  4337.         See Also:
  4338.            AppExist, Delay, RunWait, WinExeName, Yield
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.          ________________________________________________________________
  4356.                                                                        70
  4357.  
  4358.                                                                   AskLine
  4359.          ________________________________________________________________
  4360.  
  4361.  
  4362.  
  4363.  
  4364.         AskLine
  4365.         Prompts the user for one line of input.
  4366.  
  4367.  
  4368.         Syntax:
  4369.          AskLine (title, prompt, default)
  4370.  
  4371.         Parameters:
  4372.          (s) title    title of the dialog box.
  4373.          (s) prompt   question to be put to the user.
  4374.          (s) default  default answer.
  4375.  
  4376.         Returns:
  4377.          (s)          user response.
  4378.  
  4379.         Use this function to query the user for a line of data.  The entire
  4380.         user response will be returned if the user presses the OK button or
  4381.         the Enter key.  If the user presses the Cancel button or the Esc
  4382.         key, the processing of the WIL program is canceled.
  4383.  
  4384.  
  4385.         Example:
  4386.          name = AskLine("Game", "Please enter your name", "")
  4387.          game = AskLine("Game", "Favorite game?", "Solitaire")
  4388.          message(StrCat(name,"'s favorite game is "), game)
  4389.  
  4390.         produces:
  4391.               ..............................................
  4392.               .                Game                        .
  4393.               ..............................................
  4394.               .  Please enter your name                    .
  4395.               .   ______________________________________   .
  4396.               .  | Richard                              |  .
  4397.               .  |______________________________________|  .
  4398.               .                                            .
  4399.               .        [OK]                [Cancel]        .
  4400.               ..............................................
  4401.  
  4402.  
  4403.               ..............................................
  4404.               .                 Game                       .
  4405.               ..............................................
  4406.               .  Favorite game?                            .
  4407.               .   ______________________________________   .
  4408.               .  | Solitaire                            |  .
  4409.               .  |______________________________________|  .
  4410.               .                                            .
  4411.               .        [OK]                [Cancel]        .
  4412.               ..............................................
  4413.          ________________________________________________________________
  4414.                                                                        71
  4415.  
  4416.                                                                   AskLine
  4417.          ________________________________________________________________
  4418.  
  4419.  
  4420.  
  4421.         And then, if Richard types "Scramble" and clicks on the OK button:
  4422.  
  4423.               ....................................
  4424.               .     Richard's favorite game is   .
  4425.               ....................................
  4426.               .                                  .
  4427.               .             Scramble             .
  4428.               .               [OK]               .
  4429.               ....................................
  4430.  
  4431.         See Also:
  4432.            AskPassword, AskYesNo, Dialog, Display, ItemSelect, Message,
  4433.            Pause, TextBox, TextSelect
  4434.  
  4435.  
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.  
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.          ________________________________________________________________
  4472.                                                                        72
  4473.  
  4474.                                                               AskPassword
  4475.          ________________________________________________________________
  4476.  
  4477.  
  4478.  
  4479.  
  4480.         AskPassword
  4481.         Prompts the user for a password.
  4482.  
  4483.  
  4484.         Syntax:
  4485.          AskPassword (title, prompt)
  4486.  
  4487.         Parameters:
  4488.          (s) title    title of the dialog box.
  4489.          (s) prompt   question to be put to the user.
  4490.  
  4491.         Returns:
  4492.          (s)          user response.
  4493.  
  4494.         Pops up a special dialog box to ask for a password.  An asterisk
  4495.         (*) is echoed for each character that the user types; the actual
  4496.         characters entered are not displayed.  The entire user response
  4497.         will be returned if the user presses the OK button or the Enter
  4498.         key.  If the user presses the Cancel button or the Esc key, the
  4499.         processing of the WIL program is canceled.
  4500.  
  4501.  
  4502.         Example:
  4503.          pw = AskPassword("Security check", "Please enter your password")
  4504.          If StriCmp(pw, "winguy") != 0 Then Goto nogo
  4505.          Run(Environment("COMSPEC"), "")
  4506.          Exit
  4507.          :nogo
  4508.          Pause("Security breach", "Invalid password entered")
  4509.  
  4510.  
  4511.         See Also:
  4512.            AskLine, AskYesNo, Dialog
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.          ________________________________________________________________
  4530.                                                                        73
  4531.  
  4532.                                                                  AskYesNo
  4533.          ________________________________________________________________
  4534.  
  4535.  
  4536.  
  4537.  
  4538.         AskYesNo
  4539.         Prompts the user for a Yes or No answer.
  4540.  
  4541.  
  4542.         Syntax:
  4543.          AskYesNo (title, question)
  4544.  
  4545.         Parameters
  4546.          (s) title      title of the question box.
  4547.          (s) question   question to be put to the user.
  4548.  
  4549.         Returns:
  4550.          (i)          @YES or @NO, depending on the button pressed.
  4551.  
  4552.         This function displays a message box with three pushbuttons - Yes,
  4553.         No, and Cancel.  If the user presses Cancel, the current WIL
  4554.         program is ended, so there is no return value.
  4555.  
  4556.  
  4557.         Example:
  4558.          q = AskYesNo('Testing', 'Please press "YES"')
  4559.          If q == @YES Then Exit
  4560.          Display(3, 'ERROR', 'I said press "YES"')
  4561.  
  4562.         Produces:
  4563.  
  4564.               ....................................
  4565.               .             Testing              .
  4566.               ....................................
  4567.               .                                  .
  4568.               .   Please press "YES"             .
  4569.               .                                  .
  4570.               .   [Yes]      [No]      [Cancel]  .
  4571.               ....................................
  4572.  
  4573.  
  4574.         And then, if the user presses No:
  4575.  
  4576.               ..........................
  4577.               .          ERROR         .
  4578.               ..........................
  4579.               .                        .
  4580.               .   I said press "YES"   .
  4581.               .                        .
  4582.               ..........................
  4583.  
  4584.         See Also:
  4585.            AskLine, AskPassword, Dialog, Display, ItemSelect, Message,
  4586.            Pause, TextBox
  4587.          ________________________________________________________________
  4588.                                                                        74
  4589.  
  4590.                                                                   Average
  4591.          ________________________________________________________________
  4592.  
  4593.  
  4594.  
  4595.  
  4596.         Average
  4597.         Returns the average of a list of numbers.
  4598.  
  4599.  
  4600.         Syntax:
  4601.          Average (integer [, integer...])
  4602.  
  4603.         Parameters:
  4604.          (i) integer  integers to get the average of.
  4605.  
  4606.         Returns:
  4607.          (i)          average of the integers.
  4608.  
  4609.         Use this function to compute the mean average of a series of
  4610.         numbers, delimited by commas.  This function returns an integer
  4611.         value, so there can be some rounding error involved.
  4612.  
  4613.  
  4614.         Example:
  4615.          avg = Average(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
  4616.          Message("The average is", avg)
  4617.  
  4618.  
  4619.         See Also:
  4620.            Abs, Max, Min, Random
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.          ________________________________________________________________
  4646.                                                                        75
  4647.  
  4648.                                                                      Beep
  4649.          ________________________________________________________________
  4650.  
  4651.  
  4652.  
  4653.  
  4654.         Beep
  4655.         Beeps once.
  4656.  
  4657.  
  4658.         Syntax:
  4659.          Beep
  4660.  
  4661.         Parameters:
  4662.          (none)
  4663.  
  4664.         Returns:
  4665.          (not applicable)
  4666.  
  4667.  
  4668.         Use this command to produce a short beep, generally to alert the
  4669.         user to an error situation or to get the user's attention.
  4670.  
  4671.  
  4672.         Example:
  4673.          Beep
  4674.          Pause("WARNING!!!", "You are about to destroy data!")
  4675.  
  4676.  
  4677.         See Also:
  4678.            PlayMedia, PlayMidi, PlayWaveForm, Sounds
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.  
  4703.          ________________________________________________________________
  4704.                                                                        76
  4705.  
  4706.                                                               ButtonNames
  4707.          ________________________________________________________________
  4708.  
  4709.  
  4710.  
  4711.  
  4712.         ButtonNames
  4713.         Changes the names of the buttons which appear in WIL dialogs.
  4714.  
  4715.  
  4716.         Syntax:
  4717.          ButtonNames (OK-name, Cancel-name)
  4718.  
  4719.         Parameters:
  4720.          (s) OK-name        new name for the OK button.
  4721.          (s) Cancel-name    new name for the Cancel button.
  4722.  
  4723.         Returns:
  4724.          (i)          always 1.
  4725.  
  4726.  
  4727.         This function allows you to specify alternate names for the OK
  4728.         and/or Cancel buttons which appear in any dialogs displayed by the
  4729.         WIL Interpreter.  Each use of the ButtonNames statement only
  4730.         affects the next WIL dialog which is displayed.
  4731.  
  4732.         You can specify a null string ("") for either the OK-name or
  4733.         Cancel-Name parameter, to use the default name for that button
  4734.         (i.e., "OK" or "Cancel").
  4735.  
  4736.         You can place an ampersand before the character which you want to
  4737.         be the underlined character in the dialog.
  4738.  
  4739.  
  4740.         Example:
  4741.          ButtonNames("", "&Abort")
  4742.          user = AskLine("Hello", "What is your name", "")
  4743.          Message("Hello", user)
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.          ________________________________________________________________
  4762.                                                                        77
  4763.  
  4764.                                                                      Call
  4765.          ________________________________________________________________
  4766.  
  4767.  
  4768.  
  4769.  
  4770.         Call
  4771.         Calls a WIL batch file as a subroutine.
  4772.  
  4773.  
  4774.         Syntax:
  4775.          Call (filename, parameters)
  4776.  
  4777.         Parameters:
  4778.          (s) filename       the WIL batch file you are calling (including
  4779.                             extension).
  4780.          (s) parameters     the parameters to pass to the file, if any, in
  4781.                             the form
  4782.                             "p1 p2 p3 ... pn".
  4783.  
  4784.         Returns:
  4785.          (i)          always 0.
  4786.  
  4787.  
  4788.         This function is used to pass control temporarily to a secondary
  4789.         WIL batch file.  The main WIL program can optionally pass
  4790.         parameters to the secondary WIL batch file.  All variables are
  4791.         common (global) between the calling program and the called WIL
  4792.         batch file, so that the secondary WIL batch file may modify or
  4793.         create variables.  The secondary WIL batch file should end with a
  4794.         Return statement, to pass control back to the main WIL program.
  4795.  
  4796.         If a string of parameters is passed to the secondary WIL batch
  4797.         file, it will automatically be parsed into individual variables
  4798.         with the names param1, param2, etc., (maximum of nine parameters).
  4799.         The variable param0 will be a count of the total number of
  4800.         parameters in the string.
  4801.  
  4802.  
  4803.         Example:
  4804.          ; MAIN.WBT
  4805.          name = AskLine("", "What is your name?", "")
  4806.          age = AskLine("", "How old are you?", "")
  4807.          valid = @NO
  4808.          Call("chek-age.wbt", age)
  4809.          If valid == @NO Then Message("", "Invalid age")
  4810.  
  4811.          ; CHEK-AGE.WBT
  4812.          userage = param1
  4813.          really = AskYesNo("", "%name%, are you really %userage%?")
  4814.          If really == @NO Then Return
  4815.          If (userage > 0) && (userage < 150) Then valid = @YES
  4816.          Return
  4817.  
  4818.  
  4819.          ________________________________________________________________
  4820.                                                                        78
  4821.  
  4822.                                                                      Call
  4823.          ________________________________________________________________
  4824.  
  4825.  
  4826.         See Also:
  4827.            ParseData, Return
  4828.  
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839.  
  4840.  
  4841.  
  4842.  
  4843.  
  4844.  
  4845.  
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.          ________________________________________________________________
  4878.                                                                        79
  4879.  
  4880.                                                                  Char2Num
  4881.          ________________________________________________________________
  4882.  
  4883.  
  4884.  
  4885.  
  4886.         Char2Num
  4887.         Converts the first character of a string to its numeric equivalent.
  4888.  
  4889.  
  4890.         Syntax:
  4891.          Char2Num (string)
  4892.  
  4893.         Parameters:
  4894.          (s) string   any text string.  Only the first character will be
  4895.                       converted.
  4896.  
  4897.         Returns:
  4898.          (i)          ANSI character code.
  4899.  
  4900.         This function returns the 8-bit ANSI code corresponding to the
  4901.         first character of the string parameter.
  4902.  
  4903.         Note:  For the commonly-used characters (with codes below 128),
  4904.         ANSI and ASCII characters are identical.
  4905.  
  4906.  
  4907.         Example:
  4908.          ; Show the hex equivalent of entered character
  4909.          inpchar = AskLine("ANSI Equivalents", "Char:", "")
  4910.          ansi = StrSub(inpchar, 1, 1)
  4911.          ansiequiv = Char2Num(InpChar)
  4912.          Message("ANSI Codes", "%ansi% => %ansiequiv%")
  4913.  
  4914.  
  4915.         See Also:
  4916.            IsNumber, Num2Char
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.          ________________________________________________________________
  4936.                                                                        80
  4937.  
  4938.                                                                ClipAppend
  4939.          ________________________________________________________________
  4940.  
  4941.  
  4942.  
  4943.  
  4944.         ClipAppend
  4945.         Appends a string to the Clipboard.
  4946.  
  4947.  
  4948.         Syntax:
  4949.          ClipAppend (string)
  4950.  
  4951.         Parameters:
  4952.          (s) string   text string to add to Clipboard.
  4953.  
  4954.         Returns:
  4955.          (i)          @TRUE if string was appended;
  4956.                       @FALSE if Clipboard ran out of memory.
  4957.  
  4958.         Use this function to append a string to the Windows Clipboard.  The
  4959.         Clipboard must either contain text data or be empty for this
  4960.         function to succeed.
  4961.  
  4962.  
  4963.         Example:
  4964.          ; The code below will append 2 copies of the
  4965.          ; Clipboard contents back to the Clipboard, resulting
  4966.          ; in 3 copies of the original contents with a CR/LF
  4967.          ; between each copy.
  4968.          a = ClipGet()
  4969.          crlf = StrCat(Num2Char(13), Num2Char(10))
  4970.          ClipAppend(crlf)
  4971.          ClipAppend(a)
  4972.          ClipAppend(crlf)
  4973.          ClipAppend(a)
  4974.  
  4975.  
  4976.         See Also:
  4977.            ClipGet, ClipPut
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.          ________________________________________________________________
  4994.                                                                        81
  4995.  
  4996.                                                                   ClipGet
  4997.          ________________________________________________________________
  4998.  
  4999.  
  5000.  
  5001.  
  5002.         ClipGet
  5003.         Returns the contents of the Clipboard.
  5004.  
  5005.  
  5006.         Syntax:
  5007.          ClipGet ( )
  5008.  
  5009.         Parameters:
  5010.          (none)
  5011.  
  5012.         Returns:
  5013.          (s)          Clipboard contents.
  5014.  
  5015.         Use this function to copy text from the Windows Clipboard into a
  5016.         string variable.
  5017.  
  5018.         Note:  If the Clipboard contains an excessively large string a
  5019.         (fatal) out of memory error may occur.
  5020.  
  5021.  
  5022.         Example:
  5023.          ; The code below will convert Clipboard contents to
  5024.          ; uppercase
  5025.          ClipPut(StrUpper(ClipGet()))
  5026.          a = ClipGet()
  5027.          Message("UPPERCASE Clipboard Contents", a)
  5028.  
  5029.  
  5030.         See Also:
  5031.            ClipAppend, ClipPut
  5032.  
  5033.  
  5034.  
  5035.  
  5036.  
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.          ________________________________________________________________
  5052.                                                                        82
  5053.  
  5054.                                                                   ClipPut
  5055.          ________________________________________________________________
  5056.  
  5057.  
  5058.  
  5059.  
  5060.         ClipPut
  5061.         Copies a string to the Clipboard.
  5062.  
  5063.  
  5064.         Syntax:
  5065.          ClipPut (string)
  5066.  
  5067.         Parameters:
  5068.          (s) string   any text string.
  5069.  
  5070.         Returns:
  5071.          (i)          @TRUE if string was copied;
  5072.                       @FALSE if Clipboard ran out of memory.
  5073.  
  5074.         Use this function to copy a string to the Windows Clipboard.  The
  5075.         previous Clipboard contents will be lost.
  5076.  
  5077.  
  5078.         Example:
  5079.          ; The code below will convert Clipboard contents to
  5080.          ; lowercase
  5081.          ClipPut(StrLower(ClipGet()))
  5082.          a = ClipGet()
  5083.          Message("lowercase Clipboard Contents", a)
  5084.  
  5085.  
  5086.         See Also:
  5087.            ClipAppend, ClipGet, SnapShot
  5088.  
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.          ________________________________________________________________
  5110.                                                                        83
  5111.  
  5112.                                                          CurrentFile {*M}
  5113.          ________________________________________________________________
  5114.  
  5115.  
  5116.  
  5117.  
  5118.         CurrentFile {*M}
  5119.         Returns the selected filename.
  5120.  
  5121.  
  5122.         Syntax:
  5123.          CurrentFile ( )
  5124.  
  5125.         Parameters:
  5126.          (none)
  5127.  
  5128.         Returns:
  5129.          (s)          currently-selected file's name.
  5130.  
  5131.         When a WIL menu shell displays the files in the current directory,
  5132.         one of them may be "selected."  This function returns the name of
  5133.         that file, if any.
  5134.  
  5135.         This is different than a "highlighted" file.  When a file is
  5136.         highlighted, it shows up in inverse video (usually white-on-black).
  5137.         To find the filenames that are highlighted, see FileItemize.
  5138.  
  5139.         Note: This command is not part of the WIL Interpreter package, but
  5140.         is documented here because it has been implemented in many of the
  5141.         shell or file manager-type applications which use the WIL
  5142.         Interpreter.
  5143.  
  5144.  
  5145.         Example:
  5146.          ; ask which program to run (default = current file)
  5147.          thefile = AskLine("Run It", "Program:", CurrentFile())
  5148.          Run(thefile, "")
  5149.  
  5150.  
  5151.         See Also:
  5152.            DirGet, DirItemize, FileItemize
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.  
  5166.  
  5167.          ________________________________________________________________
  5168.                                                                        84
  5169.  
  5170.                                                                  DateTime
  5171.          ________________________________________________________________
  5172.  
  5173.  
  5174.  
  5175.  
  5176.         DateTime
  5177.         Provides the current date and time.
  5178.  
  5179.  
  5180.         Syntax:
  5181.          DateTime ( )
  5182.  
  5183.         Parameters:
  5184.          (none)
  5185.  
  5186.         Returns:
  5187.          (s)          today's date and time
  5188.  
  5189.         This function will return the current date and time in a pre-
  5190.         formatted string.  The format of the string depends on the current
  5191.         settings in the [Intl] section of the WIN.INI file:
  5192.  
  5193.         ddd mm/dd/yy hh:mm:ss XX
  5194.         ddd dd/mm/yy hh:mm:ss XX
  5195.         ddd yy/mm/dd hh:mm:ss XX
  5196.  
  5197.         Where:
  5198.            ddd is day of the week (e.g. Mon)
  5199.            mm  is the month (e.g. 10)
  5200.            dd  is the day of the month (e.g. 23)
  5201.            yy  is the year (e.g. 90)
  5202.            hh  is the hours
  5203.            mm  is the minutes
  5204.            ss  is the seconds
  5205.            XX  is the Day/Night code (e.g. AM or PM)
  5206.  
  5207.         Note:  Windows provides even more formatting options than this.
  5208.  
  5209.         The WIN.INI file will be examined to determine which format to use.
  5210.         You can adjust the WIN.INI file via the [Intl] section of Control
  5211.         Panel if the format isn't what you prefer.
  5212.  
  5213.  
  5214.         Example:
  5215.          ; assuming the current standard is U.S.
  5216.          ; (i.e. day  dd/mm/yy hh:mm:ss AM)
  5217.          Message("Current Date & Time", DateTime())
  5218.  
  5219.         would produce:
  5220.  
  5221.  
  5222.  
  5223.  
  5224.  
  5225.          ________________________________________________________________
  5226.                                                                        85
  5227.  
  5228.                                                                  DateTime
  5229.          ________________________________________________________________
  5230.  
  5231.               ................................
  5232.               .     Current Date & Time      .
  5233.               ................................
  5234.               .                              .
  5235.               .   Sat 7/23/91  9:29:23 PM    .
  5236.               .                              .
  5237.               .             [OK]             .
  5238.               ................................
  5239.  
  5240.  
  5241.         See Also:
  5242.            FileTimeGet
  5243.  
  5244.  
  5245.  
  5246.  
  5247.  
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.          ________________________________________________________________
  5284.                                                                        86
  5285.  
  5286.                                                                DDEExecute
  5287.          ________________________________________________________________
  5288.  
  5289.  
  5290.  
  5291.  
  5292.         DDEExecute
  5293.         Sends commands to a DDE server application.
  5294.  
  5295.  
  5296.         Syntax:
  5297.          DDEExecute (channel, command string)
  5298.  
  5299.         Parameters:
  5300.          (i) channel    same integer that was returned by DDEInitiate.
  5301.          (s) command    string one or more commands to be executed by the
  5302.                         server app.
  5303.  
  5304.         Returns:
  5305.          (i)          @TRUE if successful; @FALSE if unsuccessful.
  5306.  
  5307.         Use the DDEInitiate function to obtain a channel number.
  5308.  
  5309.         In order to use this function successfully, you will need
  5310.         appropriate documentation for the server application you wish to
  5311.         access, which must provide information on the DDE functions that it
  5312.         supports and the correct syntax to use.
  5313.  
  5314.  
  5315.         Example:
  5316.          Run("wincheck.exe", "TUT")
  5317.          channel = DDEInitiate("wincheck", "TUT")
  5318.          If channel == 0 Then Goto failed
  5319.          result = DDEExecute(channel, '[WriteCheck:p="Shorewood
  5320.              Apartments",t=580.00,l="Rent"]')
  5321.          DDETerminate(channel)
  5322.          WinClose("WinCheck")
  5323.          If result == @FALSE Then Goto Failed
  5324.          Message("DDE Execute", "Operation complete")
  5325.          Exit
  5326.          :failed
  5327.          Message("DDE operation unsuccessful", "Check your syntax")
  5328.  
  5329.  
  5330.         See Also:
  5331.            DDEInitiate, DDEPoke, DDERequest, DDETerminate, DDETimeout
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.          ________________________________________________________________
  5342.                                                                        87
  5343.  
  5344.                                                               DDEInitiate
  5345.          ________________________________________________________________
  5346.  
  5347.  
  5348.  
  5349.  
  5350.         DDEInitiate
  5351.         Opens a DDE channel.
  5352.  
  5353.  
  5354.         Syntax:
  5355.          DDEInitiate (app name, topic name)
  5356.  
  5357.         Parameters:
  5358.          (s) app name       name of the application
  5359.                             (usually the filename w/o the EXE extension).
  5360.          (s) topic name     name of the topic you wish to access.
  5361.  
  5362.         Returns:
  5363.          (i)                communications channel.
  5364.  
  5365.         This function opens a DDE communications channel with a server
  5366.         application.  The communications channel can be subsequently used
  5367.         by the DDEExecute, DDEPoke, and DDERequest functions.  You should
  5368.         close this channel with DDETerminate when you are finished using
  5369.         it.  If the communications channel cannot be opened as requested,
  5370.         DDEInitiate returns a channel number of 0.
  5371.  
  5372.         You can call DDEInitiate more than once, in order to carry on
  5373.         multiple DDE conversations (with multiple applications)
  5374.         simultaneously.
  5375.  
  5376.         In order to use this function successfully, you will need
  5377.         appropriate documentation for the server application you wish to
  5378.         access, which must provide information on the DDE functions that it
  5379.         supports and the correct syntax to use.
  5380.  
  5381.  
  5382.         Example:
  5383.          Run("wincheck.exe", "TUT")
  5384.          channel = DDEInitiate("WinCheck", "TUT")
  5385.          If channel == 0 Then Goto failed
  5386.          output = DDERequest(channel, "GetChecking")
  5387.          DDETerminate(channel)
  5388.          WinClose("WinCheck")
  5389.          If output == "" Then Goto Failed
  5390.          Message("Account balance", output)
  5391.          Exit
  5392.          :failed
  5393.          Message("DDE operation unsuccessful", "Check your syntax")
  5394.  
  5395.  
  5396.         See Also:
  5397.            DDEExecute, DDEPoke, DDERequest, DDETerminate, DDETimeout
  5398.  
  5399.          ________________________________________________________________
  5400.                                                                        88
  5401.  
  5402.                                                                   DDEPoke
  5403.          ________________________________________________________________
  5404.  
  5405.  
  5406.  
  5407.  
  5408.         DDEPoke
  5409.         Sends data to a DDE server application.
  5410.  
  5411.  
  5412.         Syntax:
  5413.          DDEPoke (channel, item name, item value)
  5414.  
  5415.         Parameters:
  5416.          (i) channel        same integer that was returned by DDEInitiate.
  5417.          (s) item name      identifies the type of data being sent.
  5418.          (s) item value     actual data to be sent to the server.
  5419.  
  5420.         Returns:
  5421.          (i)          @TRUE if successful; @FALSE if unsuccessful.
  5422.  
  5423.         Use the DDEInitiate function to obtain a channel number.
  5424.  
  5425.         In order to use this function successfully, you will need
  5426.         appropriate documentation for the server application you wish to
  5427.         access, which must provide information on the DDE functions that it
  5428.         supports and the correct syntax to use.
  5429.  
  5430.  
  5431.         Example:
  5432.          Run("reminder.exe", "")
  5433.          channel = DDEInitiate("Reminder", "items")
  5434.          If channel == 0 Then Goto failed
  5435.          result = DDEPoke(channel, "all", "11/3/92 Misc Remember to vote")
  5436.          DDETerminate(channel)
  5437.          WinClose("Reminder")
  5438.          If result == @FALSE Then Goto Failed
  5439.          Message("DDE Poke", "Operation complete")
  5440.          Exit
  5441.          :failed
  5442.          Message("DDE operation unsuccessful", "Check your syntax")
  5443.  
  5444.  
  5445.         See Also:
  5446.            DDEExecute, DDEInitiate, DDERequest, DDETerminate, DDETimeout
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.          ________________________________________________________________
  5458.                                                                        89
  5459.  
  5460.                                                                DDERequest
  5461.          ________________________________________________________________
  5462.  
  5463.  
  5464.  
  5465.  
  5466.         DDERequest
  5467.         Gets data from a DDE server application.
  5468.  
  5469.  
  5470.         Syntax:
  5471.          DDERequest (channel, item name)
  5472.  
  5473.         Parameters:
  5474.          (i) channel     same integer that was returned by DDEInitiate.
  5475.          (s) item name   identifies the data to be returned by the server.
  5476.  
  5477.         Returns:
  5478.          (s)          information returned from the server.
  5479.  
  5480.         Use the DDEInitiate function to obtain a channel number.
  5481.  
  5482.         In order to use this function successfully, you will need
  5483.         appropriate documentation for the server application you wish to
  5484.         access, which must provide information on the DDE functions that it
  5485.         supports and the correct syntax to use.
  5486.  
  5487.  
  5488.         Example:
  5489.          Run("wincheck.exe", "TUT")
  5490.          channel = DDEInitiate("WinCheck", "TUT")
  5491.          If channel == 0 Then Goto failed
  5492.          output = DDERequest(channel, "GetChecking")
  5493.          DDETerminate(channel)
  5494.          WinClose("WinCheck")
  5495.          If output == "" Then Goto Failed
  5496.          Message("Account balance", output)
  5497.          Exit
  5498.          :failed
  5499.          Message("DDE operation unsuccessful", "Check your syntax")
  5500.  
  5501.  
  5502.         See Also:
  5503.            DDEExecute, DDEInitiate, DDEPoke, DDETerminate, DDETimeout
  5504.  
  5505.  
  5506.  
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.          ________________________________________________________________
  5516.                                                                        90
  5517.  
  5518.                                                              DDETerminate
  5519.          ________________________________________________________________
  5520.  
  5521.  
  5522.  
  5523.  
  5524.         DDETerminate
  5525.         Closes a DDE channel.
  5526.  
  5527.  
  5528.         Syntax:
  5529.          DDETerminate (channel)
  5530.  
  5531.         Parameters:
  5532.          (i) channel    same integer that was returned by DDEInitiate.
  5533.  
  5534.         Returns:
  5535.          (i)            always 1.
  5536.  
  5537.         This function closes a communications channel that was opened with
  5538.         DDEInitiate.
  5539.  
  5540.         Example:
  5541.          Run("wincheck.exe", "TUT")
  5542.          channel = DDEInitiate("WinCheck", "TUT")
  5543.          If channel == 0 Then Goto failed
  5544.          output = DDERequest(channel, "GetChecking")
  5545.          DDETerminate(channel)
  5546.          WinClose("WinCheck")
  5547.          If output == "" Then Goto Failed
  5548.          Message("Account balance", output)
  5549.          Exit
  5550.          :failed
  5551.          Message("DDE operation unsuccessful", "Check your syntax")
  5552.  
  5553.  
  5554.         See Also:
  5555.            DDEExecute, DDEInitiate, DDEPoke, DDERequest, DDETimeout
  5556.  
  5557.  
  5558.  
  5559.  
  5560.  
  5561.  
  5562.  
  5563.  
  5564.  
  5565.  
  5566.  
  5567.  
  5568.  
  5569.  
  5570.  
  5571.  
  5572.  
  5573.          ________________________________________________________________
  5574.                                                                        91
  5575.  
  5576.                                                                DDETimeout
  5577.          ________________________________________________________________
  5578.  
  5579.  
  5580.  
  5581.  
  5582.         DDETimeout
  5583.         Sets the DDE timeout value.
  5584.  
  5585.  
  5586.         Syntax:
  5587.          DDETimeout (value)
  5588.  
  5589.         Parameters:
  5590.          (i) value    DDE timeout time.
  5591.  
  5592.         Returns:
  5593.          (i)          previous timeout value.
  5594.  
  5595.         Sets the timeout time for subsequent DDE functions to specified
  5596.         value in milliseconds (1/1000 second).  Default is 3000
  5597.         milliseconds (3 seconds).  If the time elapses with no response,
  5598.         the WIL Interpreter will return an error.  The value set with
  5599.         DDETimeout stays in effect until changed by another DDETimeout
  5600.         statement or until the WIL program ends, whichever comes first.
  5601.  
  5602.  
  5603.         Example:
  5604.          DDETimeout(5000)
  5605.          Run("wincheck.exe", "TUT")
  5606.          channel = DDEInitiate("WinCheck", "TUT")
  5607.          If channel == 0 Then Goto failed
  5608.          output = DDERequest(channel, "GetChecking")
  5609.          DDETerminate(channel)
  5610.          WinClose("WinCheck")
  5611.          If output == "" Then Goto Failed
  5612.          Message("Account balance", output)
  5613.          Exit
  5614.          :failed
  5615.          Message("DDE operation unsuccessful", "Check your syntax")
  5616.  
  5617.  
  5618.         See Also:
  5619.            DDEExecute, DDEInitiate, DDEPoke, DDERequest, DDETerminate
  5620.  
  5621.  
  5622.  
  5623.  
  5624.  
  5625.  
  5626.  
  5627.  
  5628.  
  5629.  
  5630.  
  5631.          ________________________________________________________________
  5632.                                                                        92
  5633.  
  5634.                                                                     Debug
  5635.          ________________________________________________________________
  5636.  
  5637.  
  5638.  
  5639.  
  5640.         Debug
  5641.         Controls the debug mode.
  5642.  
  5643.  
  5644.         Syntax:
  5645.          Debug (mode)
  5646.  
  5647.         Parameters:
  5648.          (i) mode     @ON or @OFF
  5649.  
  5650.         Returns:
  5651.          (i)          previous debug mode
  5652.  
  5653.         Use this function to turn the debug mode on or off.  The default is
  5654.         @OFF.
  5655.  
  5656.         When debug mode is on, the WIL Interpreter will display the
  5657.         statement just executed, its result (if any), any error conditions,
  5658.         and the next statement to execute.
  5659.  
  5660.         The statements are displayed in a special dialog box which gives
  5661.         the user four options:  Next, Run, Cancel and Show Var.
  5662.  
  5663.         Next executes the next statement and remains in debug mode.
  5664.  
  5665.         Run exits debug mode and runs the rest of the program normally.
  5666.  
  5667.         Cancel terminates the current WIL program.
  5668.  
  5669.         Show Var displays the contents of a variable whose name the user
  5670.         entered in the edit box.
  5671.  
  5672.  
  5673.         Example:
  5674.          Debug(@ON)
  5675.          a = 6
  5676.          q = AskYesNo("Testing Debug Mode", "Is the Pope Catholic")
  5677.          Debug(@OFF)
  5678.          b = a + 4
  5679.  
  5680.         produces:
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.          ________________________________________________________________
  5690.                                                                        93
  5691.  
  5692.                                                                     Debug
  5693.          ________________________________________________________________
  5694.  
  5695.  
  5696.               ...................................................
  5697.               .                   DEBUG                         .
  5698.               ...................................................
  5699.               .  *** Debug Initialized ***                      .
  5700.               .  Value => 0                                     .
  5701.               .                                                 .
  5702.               .  Next Statement                                 .
  5703.               .  a=6                                            .
  5704.               .  __________________________________             .
  5705.               . |                                  | [Show Var] .
  5706.               . |__________________________________|            .
  5707.               .                                                 .
  5708.               .   [Next]         [Run]         [Cancel]         .
  5709.               ...................................................
  5710.  
  5711.  
  5712.         ... then, if the user presses Next:
  5713.  
  5714.               ...................................................
  5715.               .                   DEBUG                         .
  5716.               ...................................................
  5717.               .  a=6                                            .
  5718.               .  Value => 6                                     .
  5719.               .                                                 .
  5720.               .  Next Statement                                 .
  5721.               .  q = AskYesNo("Testing Debug Mode", "Is the Po  .
  5722.               .  __________________________________             .
  5723.               . |                                  | [Show Var] .
  5724.               . |__________________________________|            .
  5725.               .                                                 .
  5726.               .   [Next]         [Run]         [Cancel]         .
  5727.               ...................................................
  5728.  
  5729.  
  5730.         ... and presses Next again:
  5731.  
  5732.  
  5733.               ...................................
  5734.               .       Testing Debug Mode        .
  5735.               ...................................
  5736.               .                                 .
  5737.               .      Is the Pope Catholic?      .
  5738.               .                                 .
  5739.               .   [Yes]     [No]     [Cancel]   .
  5740.               ...................................
  5741.  
  5742.  
  5743.         ... and then presses Yes:
  5744.  
  5745.  
  5746.  
  5747.          ________________________________________________________________
  5748.                                                                        94
  5749.  
  5750.                                                                     Debug
  5751.          ________________________________________________________________
  5752.  
  5753.  
  5754.               ...................................................
  5755.               .                   DEBUG                         .
  5756.               ...................................................
  5757.               .  q = AskYesNo("Testing Debug Mode", "Is the Po  .
  5758.               .  Value => 1                                     .
  5759.               .                                                 .
  5760.               .  Next Statement                                 .
  5761.               .  Debug(@OFF)                                    .
  5762.               .  __________________________________             .
  5763.               . |                                  | [Show Var] .
  5764.               . |__________________________________|            .
  5765.               .                                                 .
  5766.               .   [Next]         [Run]         [Cancel]         .
  5767.               ...................................................
  5768.  
  5769.  
  5770.         etc.  (If the user had pressed No it would have said "VALUE=>0".)
  5771.  
  5772.  
  5773.         See Also:
  5774.            ErrorMode, LastError, SKDebug
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.          ________________________________________________________________
  5806.                                                                        95
  5807.  
  5808.                                                                     Delay
  5809.          ________________________________________________________________
  5810.  
  5811.  
  5812.  
  5813.  
  5814.         Delay
  5815.         Pauses execution for a specified amount of time.
  5816.  
  5817.  
  5818.         Syntax:
  5819.          Delay (seconds)
  5820.  
  5821.         Parameters:
  5822.          (i) seconds    integer seconds to delay (2 - 3600)
  5823.  
  5824.         Returns:
  5825.          (i)            always 1
  5826.  
  5827.         This function causes the currently-executing WIL program to be
  5828.         suspended for the specified period of time.  Seconds must be an
  5829.         integer between 2 and 3600.  Smaller or larger numbers will be
  5830.         adjusted accordingly.
  5831.  
  5832.  
  5833.         Example:
  5834.          Message("Wait", "About 15 seconds")
  5835.          Delay(15)
  5836.          Message("Hi", "I'm Baaaaaaack")
  5837.  
  5838.  
  5839.         See Also:
  5840.            Yield
  5841.  
  5842.  
  5843.  
  5844.  
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.          ________________________________________________________________
  5864.                                                                        96
  5865.  
  5866.                                                                    Dialog
  5867.          ________________________________________________________________
  5868.  
  5869.  
  5870.  
  5871.  
  5872.         Dialog
  5873.         Displays a user-defined dialog box.
  5874.  
  5875.  
  5876.         Syntax:
  5877.          Dialog (dialog-name)
  5878.  
  5879.         Parameters:
  5880.          (s) dialog-name    name of the dialog box.
  5881.  
  5882.         Returns:
  5883.          (i)          value of the pushbutton used to close the dialog box.
  5884.  
  5885.  
  5886.         The text which follows describes how to define a dialog box for use
  5887.         by the Dialog function.  Please refer to your product-specific
  5888.         documentation for any additional information which may supplement
  5889.         or supersede that which is described here.
  5890.  
  5891.         Before the Dialog function is called, you must include a section of
  5892.         code in your WIL program which will define the characteristics of
  5893.         the dialog box to be displayed.  First of all, the dialog must be
  5894.         declared, and a name must be assigned to it.  This is done with a
  5895.         line of the following format:
  5896.  
  5897.          <name>Format="WWWDLGED,4.0"
  5898.  
  5899.         where <name> is the dialog name.  This should follow the standard
  5900.         rules for WIL variable names, and may not exceed 17 characters in
  5901.         length.
  5902.  
  5903.         Next, the format of the dialog box is defined, as follows:
  5904.  
  5905.          <name>X           = <x-origin>
  5906.          <name>Y           = <y-origin>
  5907.          <name>Width       = <box-width>
  5908.          <name>Height      = <box-height>
  5909.          <name>NumControls = <control-count>
  5910.          <name>Caption     = "<box-caption>"
  5911.  
  5912.         where:
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.          ________________________________________________________________
  5922.                                                                        97
  5923.  
  5924.                                                                    Dialog
  5925.          ________________________________________________________________
  5926.  
  5927.          <name>          is the name of the dialog box, as described above.
  5928.          <x-origin>      is the horizontal coordinate of the upper left
  5929.                          corner of dialog box.
  5930.          <y-origin>      is the vertical coordinate of the upper left
  5931.                          corner of the dialog box.
  5932.          <box-width>     is the width of the dialog box.
  5933.          <box-height>    is the height of the dialog box.
  5934.          <control-count> is the total number of controls in the dialog box
  5935.                          (see below).
  5936.          <box-caption>   is the text which will appear in the title bar of
  5937.                          the dialog box.
  5938.  
  5939.         Finally, you will need to define the objects, or controls, which
  5940.         will appear inside the dialog box.  Each control is defined with a
  5941.         line of the following format:
  5942.  
  5943.          <name>nn = `x,y,width,height,type,var,"text",value`
  5944.  
  5945.         where:
  5946.  
  5947.          "nn"         is the ordinal position of the control in the
  5948.                       dialog box (starting with 1).
  5949.          "<name>"     is the name of the dialog box, as described above.
  5950.          "x"          is the horizontal coordinate of the upper left
  5951.                       corner of the control.
  5952.          "y"          is the vertical coordinate of the upper left corner
  5953.                       of the control.
  5954.          "width"      is the width of the control.
  5955.          "height"     is the height of the control.
  5956.                       [This should be DEFAULT for all controls except
  5957.                       filelistboxes.]
  5958.          "type"       is the type of control, (see below).
  5959.          "var"        is the name of the variable affected by the control.
  5960.          "text"       is the description which will be displayed with the
  5961.                       control.  [Use a null string ("") if the control
  5962.                       should appear blank.]
  5963.          "value"      is the value returned by the control.  [Use only for
  5964.                       pushbuttons, radiobuttons, and checkboxes.]
  5965.  
  5966.  
  5967.         Note: The numbers used for "x-origin", "y-origin", "box-width",
  5968.         "box-height", "x", "y", "width," and "height" are expressed in a
  5969.         unit of measure known as "Dialog Units."  Basically speaking:
  5970.  
  5971.            1 width unit  = 1/4 width of system font.
  5972.            1 height unit = 1/4 width of system font.
  5973.            4 units wide  = Average width of the system font.
  5974.            8 units high  = Average height of the system font.
  5975.  
  5976.  
  5977.         There are seven types of controls available:
  5978.  
  5979.          ________________________________________________________________
  5980.                                                                        98
  5981.  
  5982.                                                                    Dialog
  5983.          ________________________________________________________________
  5984.  
  5985.  
  5986.            PUSHBUTTON  A button, which can be labeled and used as desired.
  5987.  
  5988.                        When the user presses a pushbutton, the Dialog
  5989.                        function will exit and will return the "value"
  5990.                        assigned to the button which was pressed. Therefore,
  5991.                        you should assign a unique "value" to each
  5992.                        pushbutton in a dialog.
  5993.  
  5994.                        Pushbuttons with values of 0 and 1 have special
  5995.                        meaning.  If the user presses a pushbutton which has
  5996.                        a value of 0, the WIL program will be terminated (or
  5997.                        will go to the label marked ":CANCEL", if one is
  5998.                        defined);  this corresponds to the behavior of the
  5999.                        familiar Cancel button.  A pushbutton with a value
  6000.                        of 1 is the default pushbutton, and will be selected
  6001.                        if the user presses the Enter key; this corresponds
  6002.                        to the behavior of the familiar OK button.
  6003.  
  6004.                        Note: Every dialog box must contain at least one
  6005.                                  pushbutton.
  6006.                              For pushbuttons, "var" should be DEFAULT.
  6007.  
  6008.  
  6009.            RADIOBUTTON One of a group of circular buttons, only one of
  6010.                        which can be "pressed" (filled in) at any given
  6011.                        time.  You can have more than one group of radio
  6012.                        buttons in a dialog box, but each group must use a
  6013.                        different "var".  When the Dialog function exits,
  6014.                        the value of "var" will be equal to the "value"
  6015.                        assigned to the radiobutton which is pressed.
  6016.                        Therefore, you should assign a unique "value" to
  6017.                        each radiobutton in a group.
  6018.  
  6019.                        Normally, when a dialog box opens, the default
  6020.                        radiobutton in each group (i.e., the one which is
  6021.                        pressed) is the one which has a value of 1.  You can
  6022.                        change this by assigning a different value to "var"
  6023.                        before calling the Dialog function.
  6024.  
  6025.  
  6026.            CHECKBOX    A square box, in which an "X" appears when selected.
  6027.                        A check box can have a value of 0 (un-checked) or 1
  6028.                        (checked).
  6029.  
  6030.                        Each checkbox in a dialog should use a unique "var".
  6031.  
  6032.                        Normally, when a dialog box opens, every checkbox
  6033.                        defaults to being un-checked.  You can change this
  6034.                        by assigning a value of 1 to "var" before calling
  6035.                        the Dialog function.
  6036.  
  6037.          ________________________________________________________________
  6038.                                                                        99
  6039.  
  6040.                                                                    Dialog
  6041.          ________________________________________________________________
  6042.  
  6043.                        Note for advanced users only: it is possible to
  6044.                        define a group of checkboxes which have the same
  6045.                        "var".  Each box in the group must have a unique
  6046.                        value, which must be a power of 2 (1, 2, 4, etc.).
  6047.                        The user can check and uncheck individual checkboxes
  6048.                        in the group, and when the Dialog function exits the
  6049.                        value of "var" will be equal to the values of all
  6050.                        the checkboxes in the group, combined using the
  6051.                        bitwise OR operator (|).
  6052.  
  6053.            EDITBOX     A box in which text can be typed.  Whatever the user
  6054.                        types in the editbox will be assigned to the
  6055.                        variable    "var".
  6056.  
  6057.                        Normally, when a dialog box opens, editboxes are
  6058.                        empty.  You can change this by assigning a value to
  6059.                        the string variable "var" before calling the Dialog
  6060.                        function, in which case the value of "var" will be
  6061.                        displayed in the editbox.
  6062.  
  6063.  
  6064.            STATICTEXT  Descriptive text, which does not change.  This can
  6065.                        be used to display titles, instructions, etc.
  6066.  
  6067.                        For statictext controls, "var" should be DEFAULT.
  6068.  
  6069.  
  6070.            VARYTEXT    Variable text.  The current value of "var" is
  6071.                        displayed.  If "var" is not assigned a value in the
  6072.                        WIL program before calling the Dialog function, the
  6073.                        "text" field of the control definition will be used.
  6074.  
  6075.            FILELISTBOX A file selection listbox.  This will allow the user
  6076.                        to select a file from any directory or drive on the
  6077.                        system.
  6078.  
  6079.                        The value of "var" will be set to the selected
  6080.                        filename; if you need to know what directory the
  6081.                        file is in, use the DirGet function after the Dialog
  6082.                        function exits.
  6083.  
  6084.                        Normally, when a dialog box opens, filelistboxes
  6085.                        display files matching a filemask of "*.*"
  6086.                        (i.e., all files).  You can change this by assigning
  6087.                        a different filemask value to the string variable
  6088.                        "var" before calling the Dialog function.
  6089.  
  6090.                        In combination with the filelistbox, you can include
  6091.                        an EDITBOX control which has the same "var" name as
  6092.                        the filelistbox.  If you do, the user can type a
  6093.                        filemask into the editbox (eg., "*.TXT"), which
  6094.  
  6095.          ________________________________________________________________
  6096.                                                                       100
  6097.  
  6098.                                                                    Dialog
  6099.          ________________________________________________________________
  6100.  
  6101.                        will cause the filelistbox to be redrawn to display
  6102.                        only those files which match the specified filemask.
  6103.  
  6104.                        Also in combination with the filelistbox, you can
  6105.                        include a VARYTEXT control which has the same "var"
  6106.                        name as the filelistbox.  If you do, this control
  6107.                        will show the  name of the directory currently
  6108.                        displayed in the  filelistbox.
  6109.  
  6110.                        For filelistboxes, "text" should be DEFAULT.
  6111.  
  6112.                        Note: You can have only one filelistbox in a dialog.
  6113.  
  6114.  
  6115.         Example:
  6116.          GeorgeFormat=`WWWDLGED,4.0`
  6117.  
  6118.          GeorgeCaption=`Sample Dialog`
  6119.          GeorgeX=56
  6120.          GeorgeY=72
  6121.          GeorgeWidth=228
  6122.          GeorgeHeight=113
  6123.          GeorgeNumControls=12
  6124.  
  6125.          George01=`20,88,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
  6126.          George02=`140,88,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0`
  6127.          George03=`8,6,98,DEFAULT,STATICTEXT,DEFAULT,"Enter your name:"`
  6128.          George04=`108,6,94,DEFAULT,EDITBOX,UserName,"<Enter name here>"`
  6129.          George05=`8,24,108,DEFAULT,STATICTEXT,DEFAULT,"Choose an OpSys:"`
  6130.          George06=`18,38,64,DEFAULT,RADIOBUTTON,Rad,"DOS",1`
  6131.          George07=`18,50,64,DEFAULT,RADIOBUTTON,Rad,"Windows",2`
  6132.          George08=`18,62,64,DEFAULT,RADIOBUTTON,Rad,"OS/2",3`
  6133.          George09=`130,24,88,DEFAULT,STATICTEXT,DEFAULT,"Check ones used:"`
  6134.          George10=`144,38,64,DEFAULT,CHECKBOX,CHKDOS,"DOS",1`
  6135.          George11=`144,50,64,DEFAULT,CHECKBOX,CHKWIN,"Windows",1`
  6136.          George12=`144,62,64,DEFAULT,CHECKBOX,CHKOS2,"OS/2",1`
  6137.  
  6138.          Dialog("George")
  6139.  
  6140.  
  6141.         See Also:
  6142.            AskLine, AskPassword, AskYesNo, DialogBox, ItemSelect
  6143.  
  6144.  
  6145.  
  6146.  
  6147.  
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153.          ________________________________________________________________
  6154.                                                                       101
  6155.  
  6156.                                                                 DialogBox
  6157.          ________________________________________________________________
  6158.  
  6159.  
  6160.  
  6161.  
  6162.         DialogBox
  6163.         Pops up a Windows dialog box defined by the WDG template file.
  6164.  
  6165.  
  6166.         Syntax:
  6167.          DialogBox (title, WDG-file)
  6168.  
  6169.         Parameters:
  6170.          (s) title      the title of the dialog box.
  6171.          (s) WDG-file   the name of the WDG template file.
  6172.  
  6173.         Returns:
  6174.          (i)            always 0.
  6175.  
  6176.         Note:  This function has been entirely supplanted by the Dialog
  6177.         function, but is retained in the WIL language and documented here
  6178.         for backwards compatibility.
  6179.  
  6180.         Each element in the template file is enclosed in square brackets,
  6181.         and consists of a variable name, followed by one of the following
  6182.         symbols:
  6183.  
  6184.            Symbol Meaning                   Example
  6185.  
  6186.              +    check box                 [backup+1Save backup]
  6187.              #    edit box                  [newfile#   ]
  6188.              \    file selection listbox    [editfile\     ]
  6189.              ^    radio button              [prog^1Note]     [prog^2Write]
  6190.              $    variable                  [var$]
  6191.  
  6192.         The number following the check box and radio button symbols is the
  6193.         value which will get assigned to the variable if its corresponding
  6194.         box is checked, or button is selected.  Following the number is the
  6195.         descriptive text which will appear next to the box or button.
  6196.  
  6197.         When used in conjunction with a file selection list box variable
  6198.         with the same name, two of these symbols have special meanings:
  6199.  
  6200.              #    file mask edit box            [editfile#     ]
  6201.              $    directory variable            [editfile$     ]
  6202.  
  6203.         Anything not appearing within square brackets is displayed as text.
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.          ________________________________________________________________
  6212.                                                                       102
  6213.  
  6214.                                                                 DialogBox
  6215.          ________________________________________________________________
  6216.  
  6217.  
  6218.         Example:
  6219.          DialogBox("Edit a file", "edit.wdg")
  6220.          If backup == 0 Then Goto nobackup
  6221.          filebackupname = StrCat(FileRoot(editfile), ".", "bak")
  6222.          FileCopy(editfile, filebackupname, @TRUE)
  6223.          :nobackup
  6224.          If prog == 1 Then Run("notepad.exe", editfile)
  6225.          If prog == 2 Then Run("c:\win\apps\winedit.exe", editfile)
  6226.  
  6227.         Here is the template file, EDIT.WDG:
  6228.  
  6229.          [editfile$       ]
  6230.               File mask [editfile#    ]
  6231.          [editfile\                      ]
  6232.          [editfile\                      ]
  6233.          [editfile\                      ]
  6234.          [editfile\                      ]
  6235.          [editfile\                      ]
  6236.          [backup+1Save backup of file]
  6237.          [prog^1Notepad]     [prog^2WinEdit]
  6238.  
  6239.  
  6240.         See Also:
  6241.            AskLine, AskPassword, AskYesNo, Dialog, ItemSelect
  6242.  
  6243.  
  6244.  
  6245.  
  6246.  
  6247.  
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.          ________________________________________________________________
  6270.                                                                       103
  6271.  
  6272.                                                                 DirChange
  6273.          ________________________________________________________________
  6274.  
  6275.  
  6276.  
  6277.  
  6278.         DirChange
  6279.         Changes the current directory.  Can also log a new drive.
  6280.  
  6281.  
  6282.         Syntax:
  6283.          DirChange ([d:]path)
  6284.  
  6285.         Parameters:
  6286.          (s) [d:]     an optional disk drive to log onto.
  6287.          (s) path     the desired path.
  6288.  
  6289.         Returns:
  6290.          (i)          @TRUE if directory was changed;
  6291.                       @FALSE if the path could not be found.
  6292.  
  6293.         Use this function to change the current working directory to
  6294.         another directory, either on the same or a different disk drive.
  6295.  
  6296.  
  6297.         Example:
  6298.          DirChange("c:\")
  6299.          TextBox("This is your CONFIG.SYS file", "config.sys")
  6300.  
  6301.  
  6302.         See Also:
  6303.            DirGet, DirHome, LogDisk
  6304.  
  6305.  
  6306.  
  6307.  
  6308.  
  6309.  
  6310.  
  6311.  
  6312.  
  6313.  
  6314.  
  6315.  
  6316.  
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.          ________________________________________________________________
  6328.                                                                       104
  6329.  
  6330.                                                                    DirGet
  6331.          ________________________________________________________________
  6332.  
  6333.  
  6334.  
  6335.  
  6336.         DirGet
  6337.         Gets the current working directory.
  6338.  
  6339.  
  6340.         Syntax:
  6341.          DirGet ( )
  6342.  
  6343.         Parameters:
  6344.          (none)
  6345.  
  6346.         Returns:
  6347.          (s)          current working directory.
  6348.  
  6349.         Use this function to determine which directory we are currently in.
  6350.         It's especially useful when changing drives or directories
  6351.         temporarily.
  6352.  
  6353.  
  6354.         Example:
  6355.          ; Get, then restore current working directory
  6356.          origdir = DirGet()
  6357.          DirChange("c:\")
  6358.          FileCopy("config.sys", "%origdir%xxxtemp.xyz", @FALSE)
  6359.          DirChange(origdir)
  6360.  
  6361.  
  6362.         See Also:
  6363.            CurrentFile, DirHome, DirWindows
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.          ________________________________________________________________
  6386.                                                                       105
  6387.  
  6388.                                                                   DirHome
  6389.          ________________________________________________________________
  6390.  
  6391.  
  6392.  
  6393.  
  6394.         DirHome
  6395.         Returns directory containing the WIL Interpreter's executable
  6396.         files.
  6397.  
  6398.  
  6399.         Syntax:
  6400.          DirHome ( )
  6401.  
  6402.         Parameters:
  6403.          (none)
  6404.  
  6405.         Returns:
  6406.          (s)          pathname of the home directory.
  6407.  
  6408.         Use this function to determine the directory where the current WIL
  6409.         Interpreter's executable files are stored.
  6410.  
  6411.  
  6412.         Example:
  6413.          a = DirHome()
  6414.          Message("WIL Executable is in ", a)
  6415.  
  6416.  
  6417.         See Also:
  6418.            DirGet, DirWindows
  6419.  
  6420.  
  6421.  
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.  
  6428.  
  6429.  
  6430.  
  6431.  
  6432.  
  6433.  
  6434.  
  6435.  
  6436.  
  6437.  
  6438.  
  6439.  
  6440.  
  6441.  
  6442.  
  6443.          ________________________________________________________________
  6444.                                                                       106
  6445.  
  6446.                                                                DirItemize
  6447.          ________________________________________________________________
  6448.  
  6449.  
  6450.  
  6451.  
  6452.         DirItemize
  6453.         Returns a space-delimited list of directories.
  6454.  
  6455.  
  6456.         Syntax:
  6457.          DirItemize (dir-list)
  6458.  
  6459.         Parameters:
  6460.          (s) dir-list    a string containing a set of subdirectory names,
  6461.                          which may be wildcarded.
  6462.  
  6463.         Returns:
  6464.          (s)             list of directories.
  6465.  
  6466.         This function compiles a list of subdirectories and separates the
  6467.         names with spaces.
  6468.  
  6469.         This is especially useful in conjunction with the ItemSelect
  6470.         function, which enables the user to choose an item from such a
  6471.         space-delimited list.
  6472.  
  6473.         DirItemize("*.*") returns all subdirectories under the current
  6474.         directory.
  6475.  
  6476.         Note: Some shell or file manager applications using the WIL
  6477.         Interpreter allow an empty string ("") to be used as the "dir-list"
  6478.         parameter, in which case all subdirectories highlighted in the file
  6479.         display are returned.  However, if there are any directory names or
  6480.         wildcards in the string, all subdirectories matching the pathnames
  6481.         are returned, regardless of which ones are highlighted.
  6482.  
  6483.  
  6484.         Example:
  6485.          a = DirItemize("*.*")
  6486.          ItemSelect("Directories", a, " ")
  6487.  
  6488.  
  6489.         See Also:
  6490.            CurrentFile, FileItemize, ItemSelect, TextSelect, WinItemize
  6491.  
  6492.  
  6493.  
  6494.  
  6495.  
  6496.  
  6497.  
  6498.  
  6499.  
  6500.  
  6501.          ________________________________________________________________
  6502.                                                                       107
  6503.  
  6504.                                                                   DirMake
  6505.          ________________________________________________________________
  6506.  
  6507.  
  6508.  
  6509.  
  6510.         DirMake
  6511.         Creates a new directory.
  6512.  
  6513.  
  6514.         Syntax:
  6515.          DirMake ([d:]path)
  6516.  
  6517.         Parameters:
  6518.          (s) [d:]     the desired disk drive.
  6519.          (s) path     the path to create.
  6520.  
  6521.         Returns:
  6522.          (i)          @TRUE if the directory was successfully created;
  6523.                       @FALSE if it wasn't.
  6524.  
  6525.         Use this function to create a new directory.
  6526.  
  6527.  
  6528.         Example:
  6529.          DirMake("c:\xxxstuff")
  6530.  
  6531.  
  6532.         See Also:
  6533.            DirRemove, DirRename
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.  
  6542.  
  6543.  
  6544.  
  6545.  
  6546.  
  6547.  
  6548.  
  6549.  
  6550.  
  6551.  
  6552.  
  6553.  
  6554.  
  6555.  
  6556.  
  6557.  
  6558.  
  6559.          ________________________________________________________________
  6560.                                                                       108
  6561.  
  6562.                                                                 DirRemove
  6563.          ________________________________________________________________
  6564.  
  6565.  
  6566.  
  6567.  
  6568.         DirRemove
  6569.         Removes a directory.
  6570.  
  6571.  
  6572.         Syntax:
  6573.          DirRemove (dir-list)
  6574.  
  6575.         Parameters:
  6576.          (s) dir-list   a space-delimited list of directory pathnames.
  6577.  
  6578.         Returns:
  6579.          (i)            @TRUE if the directory was successfully removed;
  6580.                         @FALSE if it wasn't.
  6581.  
  6582.         Use this function to delete directories.  You can delete one or
  6583.         more at a time by separating directory names with spaces.  You
  6584.         cannot, however, use wildcards.
  6585.  
  6586.  
  6587.         Examples:
  6588.          DirRemove("c:\xxxstuff")
  6589.  
  6590.          DirRemove("tempdir1 tempdir2 tempdir3")
  6591.  
  6592.  
  6593.         See Also:
  6594.            DirMake, DirRename
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.  
  6608.  
  6609.  
  6610.  
  6611.  
  6612.  
  6613.  
  6614.  
  6615.  
  6616.  
  6617.          ________________________________________________________________
  6618.                                                                       109
  6619.  
  6620.                                                                 DirRename
  6621.          ________________________________________________________________
  6622.  
  6623.  
  6624.  
  6625.  
  6626.         DirRename
  6627.         Renames a directory.
  6628.  
  6629.  
  6630.         Syntax:
  6631.          DirRename ([d:]oldpath, [d:]newpath)
  6632.  
  6633.         Parameters:
  6634.          (s) oldpath    existing directory name, with optional drive.
  6635.          (s) newpath    new name for directory.
  6636.  
  6637.         Returns:
  6638.          (i)            @TRUE if the directory was successfully renamed;
  6639.                         @FALSE if it wasn't.
  6640.  
  6641.  
  6642.         Example:
  6643.          DirRename("c:\temp", "c:\work")
  6644.  
  6645.  
  6646.         See Also:
  6647.            DirMake, DirRemove
  6648.  
  6649.  
  6650.  
  6651.  
  6652.  
  6653.  
  6654.  
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661.  
  6662.  
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.  
  6673.  
  6674.  
  6675.          ________________________________________________________________
  6676.                                                                       110
  6677.  
  6678.                                                                DirWindows
  6679.          ________________________________________________________________
  6680.  
  6681.  
  6682.  
  6683.  
  6684.         DirWindows
  6685.         Returns the name of the Windows or Windows System directory.
  6686.  
  6687.  
  6688.         Syntax:
  6689.          DirWindows (request#)
  6690.  
  6691.         Parameters:
  6692.          (i) request#    see below.
  6693.  
  6694.  
  6695.         Returns:
  6696.          (s)             directory name.
  6697.  
  6698.         This function returns the name of either the Windows directory or
  6699.         the Windows System directory, depending on the request# specified.
  6700.  
  6701.            Req#   Return value
  6702.  
  6703.            0      Windows directory
  6704.            1      Windows System directory
  6705.  
  6706.  
  6707.         Example:
  6708.          DirChange(DirWindows(0))
  6709.          ini = ItemSelect("Select file to edit", FileItemize("*.ini"), " ")
  6710.          Run("notepad.exe", ini)
  6711.  
  6712.  
  6713.         See Also:
  6714.            DirGet, DirHome
  6715.  
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.  
  6726.  
  6727.  
  6728.  
  6729.  
  6730.  
  6731.  
  6732.  
  6733.          ________________________________________________________________
  6734.                                                                       111
  6735.  
  6736.                                                                  DiskFree
  6737.          ________________________________________________________________
  6738.  
  6739.  
  6740.  
  6741.  
  6742.         DiskFree
  6743.         Finds the total space available on a group of drives.
  6744.  
  6745.  
  6746.         Syntax:
  6747.          DiskFree (drive-list)
  6748.  
  6749.         Parameters:
  6750.          (s) drive-list     one or more drive letters, separated by spaces.
  6751.  
  6752.         Returns:
  6753.          (i)                the number of bytes available on all the
  6754.                             specified drives.
  6755.  
  6756.         This function takes a string consisting of drive letters, separated
  6757.         by spaces.  Only the first character of each non-blank group of
  6758.         characters is used to determine the drives, so you can use just the
  6759.         drive letters, or add a colon (:), or add a backslash (\), or even
  6760.         a whole pathname, and still get a perfectly valid result.
  6761.  
  6762.  
  6763.         Example:
  6764.          size = DiskFree("c d")
  6765.          Message("Space Available on C: and D:", size)
  6766.  
  6767.  
  6768.         See Also:
  6769.            DiskScan, FileSize
  6770.  
  6771.  
  6772.  
  6773.  
  6774.  
  6775.  
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.  
  6788.  
  6789.  
  6790.  
  6791.          ________________________________________________________________
  6792.                                                                       112
  6793.  
  6794.                                                                  DiskScan
  6795.          ________________________________________________________________
  6796.  
  6797.  
  6798.  
  6799.  
  6800.         DiskScan
  6801.         Returns list of drives.
  6802.  
  6803.  
  6804.         Syntax:
  6805.          DiskScan (request#)
  6806.  
  6807.         Parameters:
  6808.          (i) request#   see below.
  6809.  
  6810.         Returns:
  6811.          (s)            drive list.
  6812.  
  6813.         Scans disk drives on the system, and returns a space-delimited list
  6814.         of drives of the type specified by request#, in the form "A: B: C:
  6815.         D: ".
  6816.  
  6817.         The request# is a bitmask, so adding the values together (except
  6818.         for 0) returns all drive types specified; eg., a request# of 3
  6819.         returns floppy plus local hard drives.
  6820.  
  6821.            Req#   Return value
  6822.  
  6823.            0      List of unused disk IDs
  6824.            1      List of removable (floppy) drives
  6825.            2      List of local fixed (hard) drives
  6826.            4      List of remote (network) drives
  6827.  
  6828.  
  6829.         Example:
  6830.          hd = DiskScan(2)
  6831.          Message("Hard drives on system", hd)
  6832.  
  6833.  
  6834.         See Also:
  6835.            DiskFree, LogDisk
  6836.  
  6837.  
  6838.  
  6839.  
  6840.  
  6841.  
  6842.  
  6843.  
  6844.  
  6845.  
  6846.  
  6847.  
  6848.  
  6849.          ________________________________________________________________
  6850.                                                                       113
  6851.  
  6852.                                                                   Display
  6853.          ________________________________________________________________
  6854.  
  6855.  
  6856.  
  6857.  
  6858.         Display
  6859.         Displays a message to the user for a specified period of time.
  6860.  
  6861.  
  6862.         Syntax:
  6863.          Display (seconds, title, text)
  6864.  
  6865.         Parameters:
  6866.          (i) seconds    seconds to display the message (1-3600).
  6867.          (s) title      title of the window to be displayed.
  6868.          (s) text       text of the window to be displayed.
  6869.  
  6870.         Returns:
  6871.          (i)            @TRUE if terminated by user; @FALSE otherwise.
  6872.  
  6873.         Use this function to display a message for a few seconds, and then
  6874.         continue processing without user input.
  6875.  
  6876.         Seconds must be an integer between 1 and 3600.  Smaller or larger
  6877.         numbers will be adjusted accordingly.
  6878.  
  6879.         The user can make the displayed message disappear before the
  6880.         designated time has elapsed by clicking a mouse button, or by
  6881.         pressing any key.  If the user terminates the function in this
  6882.         manner, it will return a value of @TRUE; otherwise, it will return
  6883.         @FALSE.
  6884.  
  6885.  
  6886.         Example:
  6887.          Display(3, "Current window is", WinGetActive())
  6888.  
  6889.         which produces something like this:
  6890.  
  6891.               ............................
  6892.               .     Current window is    .
  6893.               ............................
  6894.               .                          .
  6895.               .        COMMAND POST      .
  6896.               ............................
  6897.  
  6898.         See Also:
  6899.            Message, Pause
  6900.  
  6901.  
  6902.  
  6903.  
  6904.  
  6905.  
  6906.  
  6907.          ________________________________________________________________
  6908.                                                                       114
  6909.  
  6910.                                                                DOSVersion
  6911.          ________________________________________________________________
  6912.  
  6913.  
  6914.  
  6915.  
  6916.         DOSVersion
  6917.         Returns the version numbers of the current version of DOS.
  6918.  
  6919.  
  6920.         Syntax:
  6921.          DOSVersion (level)
  6922.  
  6923.         Parameters:
  6924.          (i) level    @MAJOR or @MINOR.
  6925.  
  6926.         Returns:
  6927.          (i)          integer or decimal part of DOS version number.
  6928.  
  6929.         @MAJOR returns the integer part (to the left of the decimal).
  6930.         @MINOR returns the decimal part (to the right of the decimal).
  6931.  
  6932.         If the version of DOS in use is 5.0, then:
  6933.  
  6934.            DOSVersion(@MAJOR)    ==   5
  6935.            DOSVersion(@MINOR)    ==   0
  6936.  
  6937.  
  6938.         Example:
  6939.          i = DOSVersion(@MAJOR)
  6940.          d = DOSVersion(@MINOR)
  6941.          If StrLen(d) == 1 Then d = StrCat("0", d)
  6942.          Message("DOS Version", "%i%.%d%")
  6943.  
  6944.  
  6945.         See Also:
  6946.            Environment, Version, WinVersion
  6947.  
  6948.  
  6949.  
  6950.  
  6951.  
  6952.  
  6953.  
  6954.  
  6955.  
  6956.  
  6957.  
  6958.  
  6959.  
  6960.  
  6961.  
  6962.  
  6963.  
  6964.  
  6965.          ________________________________________________________________
  6966.                                                                       115
  6967.  
  6968.                                                                      Drop
  6969.          ________________________________________________________________
  6970.  
  6971.  
  6972.  
  6973.  
  6974.         Drop
  6975.         Removes variables from memory.
  6976.  
  6977.  
  6978.         Syntax:
  6979.          Drop (var, [var...])
  6980.  
  6981.         Parameters:
  6982.          (i) var      variable names to remove.
  6983.  
  6984.         Returns:
  6985.          (i)          always 1.
  6986.  
  6987.         This function removes variables from the WIL Interpreter's variable
  6988.         list, and recovers the memory associated with the variable (and
  6989.         possibly related string storage).
  6990.  
  6991.         A variable is defined the first time it appears to the left of an
  6992.         equal sign in a statement.  It stays defined until it is explicitly
  6993.         dropped with the Drop function, or until the current invocation of
  6994.         the WIL Interpreter gets closed.
  6995.  
  6996.         Generally speaking: in batch file-based implementations of WIL, all
  6997.         variables are dropped automatically at the end of every batch file;
  6998.         and in menu-based implementations of WIL, variables stay defined
  6999.         until explicitly dropped.
  7000.  
  7001.  
  7002.         Example:
  7003.          a = "A variable"
  7004.          b = "Another one"
  7005.          Drop(a, b)       ; This removes A and B from memory
  7006.  
  7007.  
  7008.         See Also:
  7009.            IsDefined
  7010.  
  7011.  
  7012.  
  7013.  
  7014.  
  7015.  
  7016.  
  7017.  
  7018.  
  7019.  
  7020.  
  7021.  
  7022.  
  7023.          ________________________________________________________________
  7024.                                                                       116
  7025.  
  7026.                                                                      Else
  7027.          ________________________________________________________________
  7028.  
  7029.  
  7030.  
  7031.  
  7032.         Else
  7033.         Continues a previous If statement.
  7034.  
  7035.  
  7036.         Syntax:
  7037.          Else statement
  7038.  
  7039.         Parameters:
  7040.          (s) statement any valid WIL function or command.
  7041.  
  7042.         This command continues the last-encountered If command.  It allows
  7043.         the user to specify an alternate action to be taken if the If
  7044.         condition was false.  If the previous If condition was false, the
  7045.         statement following the Else keyword is executed.  If the previous
  7046.         If condition was true, the statement following the Else keyword is
  7047.         ignored.
  7048.  
  7049.  
  7050.         Example:
  7051.          windir = DirWindows(0)
  7052.          inifiles = FileItemize("%windir%*.ini")
  7053.          ini = ItemSelect("INI file to edit", inifiles, " ")
  7054.          If ini == "" Then Exit
  7055.          Else Run("notepad.exe", ini)
  7056.  
  7057.  
  7058.         See Also:
  7059.            Goto, If ... Then, Then
  7060.  
  7061.  
  7062.  
  7063.  
  7064.  
  7065.  
  7066.  
  7067.  
  7068.  
  7069.  
  7070.  
  7071.  
  7072.  
  7073.  
  7074.  
  7075.  
  7076.  
  7077.  
  7078.  
  7079.  
  7080.  
  7081.          ________________________________________________________________
  7082.                                                                       117
  7083.  
  7084.                                                                EndSession
  7085.          ________________________________________________________________
  7086.  
  7087.  
  7088.  
  7089.  
  7090.         EndSession
  7091.         Ends the Windows session.
  7092.  
  7093.  
  7094.         Syntax:
  7095.          EndSession ( )
  7096.  
  7097.         Parameters:
  7098.          (none)
  7099.  
  7100.         Returns:
  7101.          (i)          always 0.
  7102.  
  7103.         Use this command to end the current Windows session, just like
  7104.         selecting Close from Program Manager's control menu.  If any active
  7105.         applications pop up dialog boxes in response to this command (such
  7106.         as prompting to save data files which have changed), the user will
  7107.         need to respond to them before Windows will close.
  7108.  
  7109.  
  7110.         Example:
  7111.          sure = AskYesNo ("End Session", "You SURE you want to exit
  7112.              Windows?")
  7113.          If sure == @No Then Goto cancel
  7114.          EndSession()
  7115.          :cancel
  7116.          Message("", "Exit Windows canceled")
  7117.  
  7118.  
  7119.         See Also:
  7120.            Exit, WinClose, WinCloseNot
  7121.  
  7122.  
  7123.  
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.  
  7135.  
  7136.  
  7137.  
  7138.  
  7139.          ________________________________________________________________
  7140.                                                                       118
  7141.  
  7142.                                                               Environment
  7143.          ________________________________________________________________
  7144.  
  7145.  
  7146.  
  7147.  
  7148.         Environment
  7149.         Gets a DOS environment variable.
  7150.  
  7151.  
  7152.         Syntax:
  7153.          Environment (env-variable)
  7154.  
  7155.         Parameters:
  7156.          (s) env-variable    any defined environment variable.
  7157.  
  7158.         Returns:
  7159.          (s)                 environment variable contents.
  7160.  
  7161.         Use this function to get the value of a DOS environment variable.
  7162.  
  7163.         Note: It is not possible to change a DOS environment variable from
  7164.         within Windows.
  7165.  
  7166.  
  7167.         Example:
  7168.          ; Display the PATH for this DOS session
  7169.          currpath = Environment("PATH")
  7170.          Message("Current DOS Path", currpath)
  7171.  
  7172.  
  7173.         See Also:
  7174.            IniRead, Version, WinMetrics, WinParmGet
  7175.  
  7176.  
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.  
  7183.  
  7184.  
  7185.  
  7186.  
  7187.  
  7188.  
  7189.  
  7190.  
  7191.  
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.          ________________________________________________________________
  7198.                                                                       119
  7199.  
  7200.                                                                 ErrorMode
  7201.          ________________________________________________________________
  7202.  
  7203.  
  7204.  
  7205.  
  7206.         ErrorMode
  7207.         Specifies how to handle errors.
  7208.  
  7209.  
  7210.         Syntax:
  7211.          ErrorMode (mode)
  7212.  
  7213.         Parameters:
  7214.          (i) mode     @CANCEL or @NOTIFY or @OFF.
  7215.  
  7216.         Returns:
  7217.          (i)          previous error setting.
  7218.  
  7219.         Use this function to control the effects of runtime errors.  The
  7220.         default is @CANCEL, meaning the execution of the WIL program will
  7221.         be canceled upon any error.
  7222.  
  7223.         @CANCEL:  All runtime errors will cause execution to be canceled.
  7224.         The user will be notified which error occurred.
  7225.  
  7226.         @NOTIFY:  All runtime errors will be reported to the user, and the
  7227.         user can choose to continue if it isn't fatal.
  7228.  
  7229.         @OFF:  Minor runtime errors will be suppressed. Moderate and fatal
  7230.         errors will be reported to the user.  User has the option of
  7231.         continuing if the error is not fatal.
  7232.  
  7233.         In general, we suggest the normal state of the program should be
  7234.         ErrorMode(@CANCEL), especially if you are writing a WIL program for
  7235.         others to use.  You can always suppress errors you expect will
  7236.         occur and then re-enable ErrorMode (@CANCEL).
  7237.  
  7238.  
  7239.         Example:
  7240.          ; Delete xxxtest.xyz.  If file doesn't exist,
  7241.          ; continue execution; don't stop
  7242.          prevmode = ErrorMode(@OFF)
  7243.          FileDelete("c:\xxxtest.xyz")
  7244.          ErrorMode(prevmode)
  7245.  
  7246.  
  7247.         See Also:
  7248.            Debug, Execute, LastError
  7249.  
  7250.  
  7251.  
  7252.  
  7253.  
  7254.  
  7255.          ________________________________________________________________
  7256.                                                                       120
  7257.  
  7258.                                                                 Exclusive
  7259.          ________________________________________________________________
  7260.  
  7261.  
  7262.  
  7263.  
  7264.         Exclusive
  7265.         Controls whether or not other Windows programs will get any time to
  7266.         execute.
  7267.  
  7268.  
  7269.         Syntax:
  7270.          Exclusive (mode)
  7271.  
  7272.         Parameters:
  7273.          (i) mode     @ON or @OFF.
  7274.  
  7275.         Returns:
  7276.          (i)          previous Exclusive mode.
  7277.  
  7278.         Exclusive(@OFF) is the default mode.  In this mode,the WIL
  7279.         Interpreter is well-behaved toward other Windows applications.
  7280.  
  7281.         Exclusive(@ON) allows WIL programs to run somewhat faster, but
  7282.         causes the WIL Interpreter to be "greedier" about sharing
  7283.         processing time with other active Windows applications.  For the
  7284.         most part, this mode is useful only when you have a series of WIL
  7285.         statements which must be executed in quick succession.
  7286.  
  7287.  
  7288.         Example:
  7289.          Exclusive(@ON)
  7290.          x = 0
  7291.          start = DateTime()
  7292.          :add
  7293.          x = x + 1
  7294.          If x < 1000 Then Goto add
  7295.          stop = DateTime()
  7296.          crlf = StrCat(Num2Char(13), Num2Char(10))
  7297.          Message("Times", "Start: %start%%crlf%Stop:  %stop%")
  7298.          Exclusive(@OFF)
  7299.  
  7300.  
  7301.         See Also:
  7302.            Yield
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.          ________________________________________________________________
  7314.                                                                       121
  7315.  
  7316.                                                                   Execute
  7317.          ________________________________________________________________
  7318.  
  7319.  
  7320.  
  7321.  
  7322.         Execute
  7323.         Executes a statement in a protected environment.  Any errors
  7324.         encountered are recoverable.
  7325.  
  7326.  
  7327.         Syntax:
  7328.          Execute statement
  7329.  
  7330.         Parameters:
  7331.          (s) statement    any executable WIL statement.
  7332.  
  7333.         Returns:
  7334.          (not applicable)
  7335.  
  7336.         Use this command to execute computed or user-entered statements.
  7337.         Due to the built-in error recovery associated with Execute, it is
  7338.         ideal for interactive execution of user-entered commands.
  7339.  
  7340.         Note that the Execute command doesn't operate on a string, per se,
  7341.         but rather on a direct statement.  If you want to put a code
  7342.         segment into a string variable, you must use the substitution
  7343.         feature of the language, as in the example below.
  7344.  
  7345.  
  7346.         Example:
  7347.          cmd = ""
  7348.          cmd = AskLine("WIL Interactive", "Command:", cmd)
  7349.          Execute %cmd%
  7350.  
  7351.  
  7352.         See Also:
  7353.            ErrorMode
  7354.  
  7355.  
  7356.  
  7357.  
  7358.  
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370.  
  7371.          ________________________________________________________________
  7372.                                                                       122
  7373.  
  7374.                                                                      Exit
  7375.          ________________________________________________________________
  7376.  
  7377.  
  7378.  
  7379.  
  7380.         Exit
  7381.         Unconditionally ends a WIL program.
  7382.  
  7383.  
  7384.         Syntax:
  7385.          Exit
  7386.  
  7387.         Parameters:
  7388.          (none)
  7389.  
  7390.         Returns:
  7391.          (not applicable)
  7392.  
  7393.         Use this command to immediately terminate a WIL program.  An Exit
  7394.         is implied at the end of each WIL program, and so is not necessary
  7395.         there.
  7396.  
  7397.  
  7398.         Example:
  7399.          a = 100
  7400.          Message("The value of a is", a)
  7401.          Exit
  7402.  
  7403.  
  7404.         See Also:
  7405.            Pause, Return, Terminate
  7406.  
  7407.  
  7408.  
  7409.  
  7410.  
  7411.  
  7412.  
  7413.  
  7414.  
  7415.  
  7416.  
  7417.  
  7418.  
  7419.  
  7420.  
  7421.  
  7422.  
  7423.  
  7424.  
  7425.  
  7426.  
  7427.  
  7428.  
  7429.          ________________________________________________________________
  7430.                                                                       123
  7431.  
  7432.                                                                FileAppend
  7433.          ________________________________________________________________
  7434.  
  7435.  
  7436.  
  7437.  
  7438.         FileAppend
  7439.         Appends one or more files to another file.
  7440.  
  7441.  
  7442.         Syntax:
  7443.          FileAppend (source-list, destination)
  7444.  
  7445.         Parameters:
  7446.          (s) source-list    a string containing one or more filenames,
  7447.                             which may be wildcarded.
  7448.          (s) destination    target file name.
  7449.  
  7450.         Returns:
  7451.          (i)          @TRUE if all files were appended successfully;
  7452.                       @FALSE if at least one file wasn't appended.
  7453.  
  7454.         Use this function to append an individual file or a group of files
  7455.         to the end of an existing file.  If destination does not exist, it
  7456.         will be created.
  7457.  
  7458.         The file(s) specified in source-list will not be modified by this
  7459.         function.
  7460.  
  7461.         Source-list may contain * and ? wildcards.  Destination may not
  7462.         contain wildcards of any type; it must be a single file name.
  7463.  
  7464.  
  7465.         Examples:
  7466.          FileAppend("c:\config.sys", "c:\misc\config.sav")
  7467.  
  7468.          DirChange("c:\batch")
  7469.          FileDelete("allbats.fil")
  7470.          FileAppend("*.bat", "allbats.fil")
  7471.  
  7472.  
  7473.         See Also:
  7474.            FileCopy, FileDelete, FileExist
  7475.  
  7476.  
  7477.  
  7478.  
  7479.  
  7480.  
  7481.  
  7482.  
  7483.  
  7484.  
  7485.  
  7486.  
  7487.          ________________________________________________________________
  7488.                                                                       124
  7489.  
  7490.                                                               FileAttrGet
  7491.          ________________________________________________________________
  7492.  
  7493.  
  7494.  
  7495.  
  7496.         FileAttrGet
  7497.         Returns file attributes.
  7498.  
  7499.  
  7500.         Syntax:
  7501.          FileAttrGet (filename)
  7502.  
  7503.         Parameters:
  7504.          (s) filename file whose attributes you want to determine.
  7505.  
  7506.         Returns:
  7507.          (s)          attribute settings.
  7508.  
  7509.         Returns attributes for the specified file, in a string of the form
  7510.         "RASH".  This string is composed of four individual attribute
  7511.         characters, as follows:
  7512.  
  7513.            Char   Symbol    Meaning
  7514.  
  7515.            1      R    Read-only ON
  7516.            2      A    Archive ON
  7517.            3      S    System ON
  7518.            4      H    Hidden ON
  7519.  
  7520.         A hyphen in any of these positions indicates that the specified
  7521.         attribute is OFF.  For example, the string "-A-H" indicates a file
  7522.         which has the Archive and Hidden attributes set.
  7523.  
  7524.  
  7525.         Example:
  7526.          editfile = "c:\config.sys"
  7527.          attr = FileAttrGet(editfile)
  7528.          If StrSub(attr, 1, 1) == "R" Then Goto readonly
  7529.          Run("notepad.exe", editfile)
  7530.          Exit
  7531.          :readonly
  7532.          Message("File is read-only", "Cannot edit %editfile%")
  7533.  
  7534.  
  7535.         See Also:
  7536.            FileAttrSet, FileTimeGet
  7537.  
  7538.  
  7539.  
  7540.  
  7541.  
  7542.  
  7543.  
  7544.  
  7545.          ________________________________________________________________
  7546.                                                                       125
  7547.  
  7548.                                                               FileAttrSet
  7549.          ________________________________________________________________
  7550.  
  7551.  
  7552.  
  7553.  
  7554.         FileAttrSet
  7555.         Sets file attributes.
  7556.  
  7557.  
  7558.         Syntax:
  7559.          FileAttrSet (file-list, settings)
  7560.  
  7561.         Parameters:
  7562.          (s) file-list space-delimited list of files.
  7563.          (s) settings new attribute settings for those file(s).
  7564.  
  7565.         Returns:
  7566.          (i)          always 0.
  7567.  
  7568.         The attribute string consists of one or more of the following
  7569.         characters (an upper case letter turns the specified attribute ON,
  7570.         a lower case letter turns it OFF):
  7571.  
  7572.            R read only ON
  7573.            A archive   ON
  7574.            S system    ON
  7575.            H hidden    ON
  7576.  
  7577.            r read only OFF
  7578.            a archive   OFF
  7579.            s system    OFF
  7580.            h hidden    OFF
  7581.  
  7582.  
  7583.         Examples:
  7584.          FileAttrSet("win.ini system.ini", "rAsH")
  7585.  
  7586.          FileAttrSet("c:\command.com", "R")
  7587.  
  7588.  
  7589.         See Also:
  7590.            FileAttrGet, FileTimeTouch
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.  
  7598.  
  7599.  
  7600.  
  7601.  
  7602.  
  7603.          ________________________________________________________________
  7604.                                                                       126
  7605.  
  7606.                                                                 FileClose
  7607.          ________________________________________________________________
  7608.  
  7609.  
  7610.  
  7611.  
  7612.         FileClose
  7613.         Closes a file.
  7614.  
  7615.  
  7616.         Syntax:
  7617.          FileClose (filehandle)
  7618.  
  7619.         Parameters:
  7620.          (i) filehandle     same integer that was returned by FileOpen.
  7621.  
  7622.         Returns:
  7623.          (i)                always 0.
  7624.  
  7625.  
  7626.         Example:
  7627.          ; the hard way to copy an ASCII file
  7628.          old = FileOpen("config.sys", "READ")
  7629.          new = FileOpen("sample.txt", "WRITE")
  7630.          :top
  7631.          x = FileRead(old)
  7632.          If x != "*EOF*" Then FileWrite(new, x)
  7633.          If x != "*EOF*" Then Goto top
  7634.          FileClose(new)
  7635.          FileClose(old)
  7636.  
  7637.  
  7638.         See Also:
  7639.            FileOpen, FileRead, FileWrite
  7640.  
  7641.  
  7642.  
  7643.  
  7644.  
  7645.  
  7646.  
  7647.  
  7648.  
  7649.  
  7650.  
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.  
  7659.  
  7660.  
  7661.          ________________________________________________________________
  7662.                                                                       127
  7663.  
  7664.                                                                  FileCopy
  7665.          ________________________________________________________________
  7666.  
  7667.  
  7668.  
  7669.  
  7670.         FileCopy
  7671.         Copies files.
  7672.  
  7673.  
  7674.         Syntax:
  7675.          FileCopy (source-list, destination, warning)
  7676.  
  7677.         Parameters:
  7678.          (s) source-list    a string containing one or more filenames,
  7679.                             which may be wildcarded.
  7680.          (s) destination    target file name.
  7681.          (i) warning        @TRUE if you want a warning before overwriting
  7682.                                   existing files;
  7683.                             @FALSE if no warning desired.
  7684.  
  7685.         Returns:
  7686.          (i)          @TRUE if all files were copied successfully;
  7687.                       @FALSE if at least one file wasn't copied.
  7688.  
  7689.         Use this function to copy an individual file, a group of files
  7690.         using wildcards, or several groups of files by separating the names
  7691.         with spaces.
  7692.  
  7693.         You can also copy files to any COM or LPT device, but do not place
  7694.         a colon after the name of the device.
  7695.  
  7696.         Source-list may contain * and ? wildcards.  Destination may contain
  7697.         the * wildcard only.
  7698.  
  7699.  
  7700.         Examples:
  7701.          FileCopy("c:\config.sys", "d:", @FALSE)
  7702.  
  7703.          FileCopy("c:\*.sys", "d:devices\*.sys", @TRUE)
  7704.  
  7705.          FileCopy("c:\config.sys", "LPT1", @FALSE)
  7706.  
  7707.  
  7708.         See Also:
  7709.            FileDelete, FileExist, FileLocate, FileMove, FileRename
  7710.  
  7711.  
  7712.  
  7713.  
  7714.  
  7715.  
  7716.  
  7717.  
  7718.  
  7719.          ________________________________________________________________
  7720.                                                                       128
  7721.  
  7722.                                                                FileDelete
  7723.          ________________________________________________________________
  7724.  
  7725.  
  7726.  
  7727.  
  7728.         FileDelete
  7729.         Deletes files.
  7730.  
  7731.  
  7732.         Syntax:
  7733.          FileDelete (file-list)
  7734.  
  7735.         Parameters:
  7736.          (s) file-list    a string containing one or more filenames, which
  7737.                           may be wildcarded.
  7738.  
  7739.         Returns:
  7740.          (i)          @TRUE if all the files were deleted;
  7741.                       @FALSE if a file didn't exist or is marked with the
  7742.                       READ-ONLY attribute.
  7743.  
  7744.         Use this function to delete an individual file, a group of files
  7745.         using wildcards, or several groups of files by separating the names
  7746.         with spaces.
  7747.  
  7748.  
  7749.         Example:
  7750.          FileDelete("*.bak temp???.fil")
  7751.  
  7752.  
  7753.         See Also:
  7754.            FileExist, FileLocate, FileMove, FileRename
  7755.  
  7756.  
  7757.  
  7758.  
  7759.  
  7760.  
  7761.  
  7762.  
  7763.  
  7764.  
  7765.  
  7766.  
  7767.  
  7768.  
  7769.  
  7770.  
  7771.  
  7772.  
  7773.  
  7774.  
  7775.  
  7776.  
  7777.          ________________________________________________________________
  7778.                                                                       129
  7779.  
  7780.                                                                 FileExist
  7781.          ________________________________________________________________
  7782.  
  7783.  
  7784.  
  7785.  
  7786.         FileExist
  7787.         Tests for the existence of files.
  7788.  
  7789.  
  7790.         Syntax:
  7791.          FileExist (filename)
  7792.  
  7793.         Parameters:
  7794.          (s) filename   either a fully qualified filename with drive and
  7795.                         path, or just a filename and extension.
  7796.  
  7797.         Returns:
  7798.          (i)          @TRUE if the file exists;
  7799.                       @FALSE if it doesn't exist or if the pathname is
  7800.                       invalid.
  7801.  
  7802.         This function is used to test whether or not a specified file
  7803.         exists.
  7804.  
  7805.         If a fully-qualified file name is used, only the specified drive
  7806.         and directory will be checked for the desired file.  If only the
  7807.         root and extension are specified, then first the current directory
  7808.         is checked for the file, and then, if the file is not found in the
  7809.         current directory, all directories in the DOS path are searched.
  7810.  
  7811.  
  7812.         Examples:
  7813.          ; check for file in current directory
  7814.          fex = FileExist(StrCat(DirGet(), "myfile.txt"))
  7815.          tex = StrSub("NOT", 1, StrLen("NOT") * fex)
  7816.          Message("MyFile.Txt"," Is %tex%in the current directory")
  7817.  
  7818.          ; check for file someplace along path
  7819.          fex = FileExist("myfile.txt")
  7820.          tex = StrSub("NOT", 1, StrLen("NOT") * fex)
  7821.          Message("MyFile.Txt", " Is %tex% in the DOS path")
  7822.  
  7823.  
  7824.         See Also:
  7825.            FileLocate
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.  
  7833.  
  7834.  
  7835.          ________________________________________________________________
  7836.                                                                       130
  7837.  
  7838.                                                             FileExtension
  7839.          ________________________________________________________________
  7840.  
  7841.  
  7842.  
  7843.  
  7844.         FileExtension
  7845.         Returns extension of file.
  7846.  
  7847.  
  7848.         Syntax:
  7849.          FileExtension (filename)
  7850.  
  7851.         Parameters:
  7852.          (s) filename [optional path]full file name, including extension.
  7853.  
  7854.         Returns:
  7855.          (s)          file extension.
  7856.  
  7857.         This function parses the passed filename and returns the extension
  7858.         part of the filename.
  7859.  
  7860.         Example:
  7861.          ; prevent the user from editing a COM or EXE file
  7862.          allfiles = FileItemize("*.*")
  7863.          editfile = ItemSelect("Select file to edit", allfiles, " ")
  7864.          ext = FileExtension(editfile)
  7865.          If (ext == "com") || (ext == "exe") Then Goto noedit
  7866.          run("notepad.exe", editfile)
  7867.          exit
  7868.          :noedit
  7869.          Message ("Sorry", "You may not edit a program file")
  7870.  
  7871.  
  7872.         See Also:
  7873.            Dialog, FilePath, FileRoot
  7874.  
  7875.  
  7876.  
  7877.  
  7878.  
  7879.  
  7880.  
  7881.  
  7882.  
  7883.  
  7884.  
  7885.  
  7886.  
  7887.  
  7888.  
  7889.  
  7890.  
  7891.  
  7892.  
  7893.          ________________________________________________________________
  7894.                                                                       131
  7895.  
  7896.                                                               FileItemize
  7897.          ________________________________________________________________
  7898.  
  7899.  
  7900.  
  7901.  
  7902.         FileItemize
  7903.         Returns a space-delimited list of files.
  7904.  
  7905.  
  7906.         Syntax:
  7907.          FileItemize (file-list)
  7908.  
  7909.         Parameters:
  7910.          (s) file-list    a string containing a list of filenames, which
  7911.                           may be wildcarded.
  7912.  
  7913.         Returns:
  7914.          (s)              space-delimited list of files.
  7915.  
  7916.         This function compiles a list of filenames and separates the names
  7917.         with spaces.
  7918.  
  7919.         This is especially useful in conjunction with the ItemSelect
  7920.         function, which lets the user choose an item from such a space-
  7921.         delimited list.
  7922.  
  7923.         Note: Some shell or file manager applications using the WIL
  7924.         Interpreter allow an empty string ("") to be used as the "file-
  7925.         list" parameter, in which case all files highlighted in the file
  7926.         display are returned.  However, if there are any file names or
  7927.         wildcards in the string, all files matching the file names are
  7928.         returned, regardless of which ones are highlighted.
  7929.  
  7930.  
  7931.         Examples:
  7932.          FileItemize("*.bak")         ;all BAK files
  7933.  
  7934.          FileItemize("*.arc *.zip *.lzh")  ;compressed files
  7935.  
  7936.          ; Get which .INI file to edit
  7937.          ifiles = FileItemize("c:\windows\*.ini")
  7938.          ifile = ItemSelect(".INI Files", ifiles, " ")
  7939.          RunZoom("notepad", ifile)
  7940.          Drop(ifiles, ifile)
  7941.  
  7942.  
  7943.         See Also:
  7944.            CurrentFile, DirItemize, ItemSelect, TextSelect, WinItemize
  7945.  
  7946.  
  7947.  
  7948.  
  7949.  
  7950.  
  7951.          ________________________________________________________________
  7952.                                                                       132
  7953.  
  7954.                                                                FileLocate
  7955.          ________________________________________________________________
  7956.  
  7957.  
  7958.  
  7959.  
  7960.         FileLocate
  7961.         Finds file in current directory or along the DOS path.
  7962.  
  7963.  
  7964.         Syntax:
  7965.          FileLocate (filename)
  7966.  
  7967.         Parameters:
  7968.          (s) filename      full file name, including extension.
  7969.  
  7970.         Returns:
  7971.          (s)               fully-qualified path name.
  7972.  
  7973.         This function is used to obtain the fully qualified path name of a
  7974.         file.  The current directory is checked first, and if the file is
  7975.         not found, the DOS path is searched.  The first occurrence of the
  7976.         file is returned.
  7977.  
  7978.  
  7979.         Example:
  7980.          ; Edit WIN.INI
  7981.          winini = FileLocate("win.ini")
  7982.          If winini == "" Then Goto notfound
  7983.          Run("notepad.exe", winini)
  7984.          Exit
  7985.          :notfound
  7986.          Message("???", "WIN.INI not found")
  7987.  
  7988.  
  7989.         See Also:
  7990.            FileExist
  7991.  
  7992.  
  7993.  
  7994.  
  7995.  
  7996.  
  7997.  
  7998.  
  7999.  
  8000.  
  8001.  
  8002.  
  8003.  
  8004.  
  8005.  
  8006.  
  8007.  
  8008.  
  8009.          ________________________________________________________________
  8010.                                                                       133
  8011.  
  8012.                                                                  FileMove
  8013.          ________________________________________________________________
  8014.  
  8015.  
  8016.  
  8017.  
  8018.         FileMove
  8019.         Moves files.
  8020.  
  8021.  
  8022.         Syntax:
  8023.          FileMove (source-list, destination, warning)
  8024.  
  8025.         Parameters:
  8026.          (s) source-list    one or more filenames separated by spaces.
  8027.          (s) destination    target filename.
  8028.          (i) warning        @TRUE if you want a warning before overwriting
  8029.                                   existing files;
  8030.                             @FALSE if no warning desired.
  8031.  
  8032.         Returns:
  8033.          (i)          @TRUE if the file was moved;
  8034.                       @FALSE if the source file was not found or had the
  8035.                       READ-ONLY attribute, or the target filename is
  8036.                       invalid.
  8037.  
  8038.         Use this function to move an individual file, a group of files
  8039.         using wildcards, or several groups of files by separating the names
  8040.         with spaces.
  8041.  
  8042.         You can move files to another drive.  You can also move a file to a
  8043.         COM or LPT port, which would cause the file to be copied to the
  8044.         port and then deleted (do not put a colon after the name of the
  8045.         port).
  8046.  
  8047.         Source-list may contain * and ? wildcards.  Destination may contain
  8048.         the * wildcard only.
  8049.  
  8050.  
  8051.         Examples:
  8052.          FileMove("c:\config.sys", "d:", @FALSE)
  8053.  
  8054.          FileMove("c:\*.sys", "d:*.sys", @TRUE)
  8055.  
  8056.  
  8057.         See Also:
  8058.            FileCopy, FileDelete, FileExist, FileLocate, FileRename
  8059.  
  8060.  
  8061.  
  8062.  
  8063.  
  8064.  
  8065.  
  8066.  
  8067.          ________________________________________________________________
  8068.                                                                       134
  8069.  
  8070.                                                                  FileOpen
  8071.          ________________________________________________________________
  8072.  
  8073.  
  8074.  
  8075.  
  8076.         FileOpen
  8077.         Opens a STANDARD ASCII (only) file for reading or writing.
  8078.  
  8079.  
  8080.         Syntax:
  8081.          FileOpen (filename, open-type)
  8082.  
  8083.         Parameters:
  8084.          (s) filename      name of the file to open.
  8085.          (s) open-type     "READ" or "WRITE".
  8086.  
  8087.         Returns:
  8088.          (i)               filehandle
  8089.  
  8090.         The filehandle returned by the FileOpen function may be
  8091.         subsequently used by the FileRead, FileWrite, and FileClose
  8092.         functions.
  8093.  
  8094.  
  8095.         Examples:
  8096.          ; To open for reading:
  8097.          handle = FileOpen("stuff.txt", "READ")
  8098.  
  8099.          ; To open for writing:
  8100.          handle = FileOpen("stuff.txt", "WRITE")
  8101.  
  8102.  
  8103.         See Also:
  8104.            FileClose, FileRead, FileWrite
  8105.  
  8106.  
  8107.  
  8108.  
  8109.  
  8110.  
  8111.  
  8112.  
  8113.  
  8114.  
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.  
  8121.  
  8122.  
  8123.  
  8124.  
  8125.          ________________________________________________________________
  8126.                                                                       135
  8127.  
  8128.                                                                  FilePath
  8129.          ________________________________________________________________
  8130.  
  8131.  
  8132.  
  8133.  
  8134.         FilePath
  8135.         Returns path of file.
  8136.  
  8137.  
  8138.         Syntax:
  8139.          FilePath (filename)
  8140.  
  8141.         Parameters:
  8142.          (s) filename     fully qualified file name, including path.
  8143.  
  8144.         Returns:
  8145.          (s)              fully qualified path name.
  8146.  
  8147.  
  8148.         FilePath parses the passed filename and returns the drive and path
  8149.         of the file specification, if any.
  8150.  
  8151.         Example:
  8152.          coms = Environment("COMSPEC")
  8153.          compath = FilePath(coms)
  8154.          Message("", "Your command processor is located in %compath%")
  8155.  
  8156.  
  8157.         See Also:
  8158.            FileExtension, FileRoot
  8159.  
  8160.  
  8161.  
  8162.  
  8163.  
  8164.  
  8165.  
  8166.  
  8167.  
  8168.  
  8169.  
  8170.  
  8171.  
  8172.  
  8173.  
  8174.  
  8175.  
  8176.  
  8177.  
  8178.  
  8179.  
  8180.  
  8181.  
  8182.  
  8183.          ________________________________________________________________
  8184.                                                                       136
  8185.  
  8186.                                                                  FileRead
  8187.          ________________________________________________________________
  8188.  
  8189.  
  8190.  
  8191.  
  8192.         FileRead
  8193.         Reads data from a file.
  8194.  
  8195.  
  8196.         Syntax:
  8197.          FileRead (filehandle)
  8198.  
  8199.         Parameters:
  8200.          (i) filehandle     same integer that was returned by FileOpen.
  8201.  
  8202.         Returns:
  8203.          (s)                line of data read from file.
  8204.  
  8205.  
  8206.         When the end of the file is reached, the string *EOF* will be
  8207.         returned.
  8208.  
  8209.  
  8210.         Example:
  8211.          handle = FileOpen("autoexec.bat", "READ")
  8212.          :readnext
  8213.          line = FileRead(handle)
  8214.          Display(4, "AUTOEXEC DATA", line)
  8215.          If line != "*EOF*" Then Goto readnext
  8216.          FileClose(handle)
  8217.  
  8218.  
  8219.         See Also:
  8220.            FileClose, FileOpen, FileWrite
  8221.  
  8222.  
  8223.  
  8224.  
  8225.  
  8226.  
  8227.  
  8228.  
  8229.  
  8230.  
  8231.  
  8232.  
  8233.  
  8234.  
  8235.  
  8236.  
  8237.  
  8238.  
  8239.  
  8240.  
  8241.          ________________________________________________________________
  8242.                                                                       137
  8243.  
  8244.                                                                FileRename
  8245.          ________________________________________________________________
  8246.  
  8247.  
  8248.  
  8249.  
  8250.         FileRename
  8251.         Renames files.
  8252.  
  8253.  
  8254.         Syntax:
  8255.          FileRename (source-list, destination)
  8256.  
  8257.         Parameters:
  8258.          (s) source-list    one or more filenames, separated by spaces.
  8259.          (s) destination    target filename.
  8260.  
  8261.         Returns:
  8262.          (i)          @TRUE if the file was renamed;
  8263.                       @FALSE if the source file was not found or had the
  8264.                       READ-ONLY attribute, or the target filename is
  8265.                       invalid.
  8266.  
  8267.         Use this function to rename an individual file, a group of files
  8268.         using wildcards, or several groups of files by separating the names
  8269.         with spaces.
  8270.  
  8271.         Note: Unlike FileMove, you cannot make a file change its resident
  8272.         disk drive with FileRename.
  8273.  
  8274.         Source-list may contain * and ? wildcards.  Destination may contain
  8275.         the * wildcard only.
  8276.  
  8277.  
  8278.         Examples:
  8279.          FileRename("c:\config.sys", "config.old")
  8280.  
  8281.          FileRename("c:\*.txt", "*.bak")
  8282.  
  8283.  
  8284.         See Also:
  8285.            FileCopy, FileExist, FileLocate, FileMove
  8286.  
  8287.  
  8288.  
  8289.  
  8290.  
  8291.  
  8292.  
  8293.  
  8294.  
  8295.  
  8296.  
  8297.  
  8298.  
  8299.          ________________________________________________________________
  8300.                                                                       138
  8301.  
  8302.                                                                  FileRoot
  8303.          ________________________________________________________________
  8304.  
  8305.  
  8306.  
  8307.  
  8308.         FileRoot
  8309.         Returns root of file.
  8310.  
  8311.  
  8312.         Syntax:
  8313.          FileRoot (filename)
  8314.  
  8315.         Parameters:
  8316.          (s) filename   [optional path]full file name, including extension
  8317.  
  8318.         Returns:
  8319.          (s)            file root.
  8320.  
  8321.  
  8322.         FileRoot parses the passed filename and returns the root part of
  8323.         the filename.
  8324.  
  8325.  
  8326.         Example:
  8327.          allfiles = FileItemize("*.*")
  8328.          editfile = ItemSelect("Select file to edit", allfiles, " ")
  8329.          root = FileRoot(editfile)
  8330.          ext = FileExtension(editfile)
  8331.          lowerext = StrLower(ext)
  8332.          nicefile = StrCat(root, ".", lowerext)
  8333.          Message("", "You are about to edit %nicefile%.")
  8334.          Run("notepad.exe", editfile)
  8335.  
  8336.  
  8337.         See Also:
  8338.            FileExtension, FilePath
  8339.  
  8340.  
  8341.  
  8342.  
  8343.  
  8344.  
  8345.  
  8346.  
  8347.  
  8348.  
  8349.  
  8350.  
  8351.  
  8352.  
  8353.  
  8354.  
  8355.  
  8356.  
  8357.          ________________________________________________________________
  8358.                                                                       139
  8359.  
  8360.                                                                  FileSize
  8361.          ________________________________________________________________
  8362.  
  8363.  
  8364.  
  8365.  
  8366.         FileSize
  8367.         Finds the total size of a group of files.
  8368.  
  8369.  
  8370.         Syntax:
  8371.          FileSize (file-list)
  8372.  
  8373.         Parameters:
  8374.          (s) file-list     zero or more filenames, separated by spaces.
  8375.  
  8376.         Returns:
  8377.          (i)               total bytes taken up by the specified file(s).
  8378.  
  8379.         This function returns the total size of the specified files.  Note
  8380.         that it doesn't handle wildcarded filenames.  You can, however, use
  8381.         FileItemize on a wildcarded filename and use the resulting string
  8382.         as a FileSize parameter.
  8383.  
  8384.  
  8385.         Example:
  8386.          size = FileSize(FileItemize("*.*"))
  8387.          Message("Size of All Files in Directory", size)
  8388.  
  8389.  
  8390.         See Also:
  8391.            DiskFree
  8392.  
  8393.  
  8394.  
  8395.  
  8396.  
  8397.  
  8398.  
  8399.  
  8400.  
  8401.  
  8402.  
  8403.  
  8404.  
  8405.  
  8406.  
  8407.  
  8408.  
  8409.  
  8410.  
  8411.  
  8412.  
  8413.  
  8414.  
  8415.          ________________________________________________________________
  8416.                                                                       140
  8417.  
  8418.                                                               FileTimeGet
  8419.          ________________________________________________________________
  8420.  
  8421.  
  8422.  
  8423.  
  8424.         FileTimeGet
  8425.         Returns file date and time.
  8426.  
  8427.  
  8428.         Syntax:
  8429.          FileTimeGet (filename)
  8430.  
  8431.         Parameters:
  8432.          (s) filename     name of file for which you want the date and time
  8433.  
  8434.         Returns:
  8435.          (s)              file date and time.
  8436.  
  8437.         This function will return the date and time of a file, in a pre-
  8438.         formatted string.  The format of the string depends on the current
  8439.         settings in the [Intl] section of the WIN.INI file:
  8440.  
  8441.         mm/dd/yy  hh:mmXX
  8442.         dd/mm/yy  hh:mmXX
  8443.         yy/mm/dd  hh:mmXX
  8444.  
  8445.         Where:
  8446.            mm  is the month (e.g. 10)
  8447.            dd  is the day of the month (e.g. 23)
  8448.            yy  is the year (e.g. 90)
  8449.            hh  is the hours
  8450.            mm  is the minutes
  8451.            XX  is the Day/Night code (e.g. AM or PM)
  8452.  
  8453.         Note:  There are two spaces between the date and the time.
  8454.  
  8455.         The WIN.INI file will be examined to determine which format to use.
  8456.         You can adjust the WIN.INI file via the International icon in
  8457.         Control Panel if the format isn't what you prefer.
  8458.  
  8459.  
  8460.         Example:
  8461.          oldtime = FileTimeGet("win.ini")
  8462.          Run("notepad.exe", "win.ini")
  8463.          WinWaitClose("Notepad - WIN.INI")
  8464.          newtime = FileTimeGet("win.ini")
  8465.          If StrCmp(oldtime, newtime) == 0 Then Exit
  8466.          Message("", "WIN.INI has been changed")
  8467.  
  8468.  
  8469.         See Also:
  8470.            DateTime, FileAttrGet, FileTimeTouch
  8471.  
  8472.  
  8473.          ________________________________________________________________
  8474.                                                                       141
  8475.  
  8476.                                                             FileTimeTouch
  8477.          ________________________________________________________________
  8478.  
  8479.  
  8480.  
  8481.  
  8482.         FileTimeTouch
  8483.         Sets file(s) to current time.
  8484.  
  8485.  
  8486.         Syntax:
  8487.          FileTimeTouch (file-list)
  8488.  
  8489.         Parameters:
  8490.          (s) file-list     a space-delimited list of files
  8491.  
  8492.         Returns:
  8493.          (i)               always 0
  8494.  
  8495.         File-list is a space-delimited list of files, which may not contain
  8496.         wildcards.  The path is searched if the file is not found in
  8497.         current directory and if the directory is not specified in file-
  8498.         list.
  8499.  
  8500.  
  8501.         Example:
  8502.          FileTimeTouch("wac.c wac.rc")
  8503.          Run("make.exe", "-fwac.mak")
  8504.  
  8505.  
  8506.         See Also:
  8507.            FileAttrSet, FileTimeGet
  8508.  
  8509.  
  8510.  
  8511.  
  8512.  
  8513.  
  8514.  
  8515.  
  8516.  
  8517.  
  8518.  
  8519.  
  8520.  
  8521.  
  8522.  
  8523.  
  8524.  
  8525.  
  8526.  
  8527.  
  8528.  
  8529.  
  8530.  
  8531.          ________________________________________________________________
  8532.                                                                       142
  8533.  
  8534.                                                                 FileWrite
  8535.          ________________________________________________________________
  8536.  
  8537.  
  8538.  
  8539.  
  8540.         FileWrite
  8541.         Writes data to a file.
  8542.  
  8543.  
  8544.         Syntax:
  8545.          FileWrite (filehandle, output-data)
  8546.  
  8547.         Parameters:
  8548.          (i) filehandle     same integer that was returned by FileOpen.
  8549.          (s) output-data    data to write to file.
  8550.  
  8551.         Returns:
  8552.          (i)                always 0.
  8553.  
  8554.  
  8555.  
  8556.         Example:
  8557.          handle = FileOpen("stuff.txt", "WRITE")
  8558.          FileWrite(handle, "Gobbledygook")
  8559.          FileClose(handle)
  8560.  
  8561.  
  8562.         See Also:
  8563.            FileClose, FileOpen, FileRead
  8564.  
  8565.  
  8566.  
  8567.  
  8568.  
  8569.  
  8570.  
  8571.  
  8572.  
  8573.  
  8574.  
  8575.  
  8576.  
  8577.  
  8578.  
  8579.  
  8580.  
  8581.  
  8582.  
  8583.  
  8584.  
  8585.  
  8586.  
  8587.  
  8588.  
  8589.          ________________________________________________________________
  8590.                                                                       143
  8591.  
  8592.                                                                      Goto
  8593.          ________________________________________________________________
  8594.  
  8595.  
  8596.  
  8597.  
  8598.         Goto
  8599.         Changes the flow of control in a WIL program.
  8600.  
  8601.  
  8602.         Syntax:
  8603.          Goto label
  8604.  
  8605.         Parameters:
  8606.          (s) label    user-defined identifier.
  8607.  
  8608.         Goto label causes an unconditional branch to the line in the
  8609.         program marked :label, where the identifier is preceded by a colon
  8610.         (:).
  8611.  
  8612.  
  8613.         Example:
  8614.          If WinExist("Solitaire") == @FALSE Then Goto open
  8615.          WinActivate("Solitaire")
  8616.          Goto loaded
  8617.          :open
  8618.          Run("sol.exe", "")
  8619.          :loaded
  8620.  
  8621.  
  8622.         See Also:
  8623.            Else, If ... Then, Then
  8624.  
  8625.  
  8626.  
  8627.  
  8628.  
  8629.  
  8630.  
  8631.  
  8632.  
  8633.  
  8634.  
  8635.  
  8636.  
  8637.  
  8638.  
  8639.  
  8640.  
  8641.  
  8642.  
  8643.  
  8644.  
  8645.  
  8646.  
  8647.          ________________________________________________________________
  8648.                                                                       144
  8649.  
  8650.                                                               IconArrange
  8651.          ________________________________________________________________
  8652.  
  8653.  
  8654.  
  8655.  
  8656.         IconArrange
  8657.         Rearranges icons.
  8658.  
  8659.  
  8660.         Syntax:
  8661.          IconArrange ( )
  8662.  
  8663.         Parameters:
  8664.          (none)
  8665.  
  8666.         Returns:
  8667.          (i)          always 0.
  8668.  
  8669.         This function rearranges the icons at the bottom of the screen,
  8670.         spacing them evenly.  It does not change the order in which the
  8671.         icons appear.
  8672.  
  8673.  
  8674.         Example:
  8675.          IconArrange ( )
  8676.  
  8677.  
  8678.         See Also:
  8679.            RunIcon, WinArrange, WinIconize, WinPlaceSet
  8680.  
  8681.  
  8682.  
  8683.  
  8684.  
  8685.  
  8686.  
  8687.  
  8688.  
  8689.  
  8690.  
  8691.  
  8692.  
  8693.  
  8694.  
  8695.  
  8696.  
  8697.  
  8698.  
  8699.  
  8700.  
  8701.  
  8702.  
  8703.  
  8704.  
  8705.          ________________________________________________________________
  8706.                                                                       145
  8707.  
  8708.                                                                 If...Then
  8709.          ________________________________________________________________
  8710.  
  8711.  
  8712.  
  8713.  
  8714.         If...Then
  8715.         Conditionally performs a function.
  8716.  
  8717.  
  8718.         Syntax:
  8719.          If condition Then statement
  8720.  
  8721.         Parameters:
  8722.          (s) condition     an expression to be evaluated.
  8723.          (s) statement     any valid WIL function or command.
  8724.  
  8725.         If the condition following the If keyword is true, the statement
  8726.         following the Then keyword is executed.  If the condition following
  8727.         the If keyword is false, the statement following the Then keyword
  8728.         is ignored.
  8729.  
  8730.         See the Else and Then commands for additional flexibility in
  8731.         conditional processing.
  8732.  
  8733.  
  8734.         Example:
  8735.          sure = AskYesNo("End Session", "Really quit Windows?")
  8736.          If sure == @YES Then EndSession()
  8737.  
  8738.  
  8739.         See Also:
  8740.            Else, Goto, Then
  8741.  
  8742.  
  8743.  
  8744.  
  8745.  
  8746.  
  8747.  
  8748.  
  8749.  
  8750.  
  8751.  
  8752.  
  8753.  
  8754.  
  8755.  
  8756.  
  8757.  
  8758.  
  8759.  
  8760.  
  8761.  
  8762.  
  8763.          ________________________________________________________________
  8764.                                                                       146
  8765.  
  8766.                                                               IgnoreInput
  8767.          ________________________________________________________________
  8768.  
  8769.  
  8770.  
  8771.  
  8772.         IgnoreInput
  8773.         Turns off hardware input to windows.
  8774.  
  8775.  
  8776.         Syntax:
  8777.          IgnoreInput (mode)
  8778.  
  8779.         Parameters:
  8780.          (i) mode     @TRUE or @FALSE.
  8781.  
  8782.         Returns:
  8783.          (i)          previous IgnoreInput mode.
  8784.  
  8785.  
  8786.         IgnoreInput causes mouse movements, clicks and keyboard entry to be
  8787.         completely ignored.  Good for self-running demos.
  8788.  
  8789.         Warning: If you are not careful with the use of IgnoreInput, you
  8790.         can easily lock up your computer!
  8791.  
  8792.  
  8793.         Example:
  8794.          username = AskLine("Hello", "Please enter your name","")
  8795.          IgnoreInput(@TRUE)
  8796.          Call("demo.wbt", username)
  8797.          IgnoreInput(@FALSE)
  8798.  
  8799.  
  8800.         See Also:
  8801.            WaitForKey
  8802.  
  8803.  
  8804.  
  8805.  
  8806.  
  8807.  
  8808.  
  8809.  
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.  
  8816.  
  8817.  
  8818.  
  8819.  
  8820.  
  8821.          ________________________________________________________________
  8822.                                                                       147
  8823.  
  8824.                                                                 IniDelete
  8825.          ________________________________________________________________
  8826.  
  8827.  
  8828.  
  8829.  
  8830.         IniDelete
  8831.         Removes a line or section from WIN.INI.
  8832.  
  8833.  
  8834.         Syntax:
  8835.          IniDelete (section, keyname)
  8836.  
  8837.         Parameters:
  8838.          (s) section    the major heading under which the item is located.
  8839.          (s) keyname    the name of the item to delete.
  8840.  
  8841.         Returns:
  8842.          (i)            always 0
  8843.  
  8844.         This function will remove the specified line from the specified
  8845.         section in WIN.INI.  You can remove an entire section, instead of
  8846.         just a single line, by specifying a keyword of @WHOLESECTION.  Case
  8847.         is not significant in section or keyname.
  8848.  
  8849.  
  8850.         Examples:
  8851.          IniDelete("Desktop", "Wallpaper")
  8852.  
  8853.          IniDelete("Quicken",@WHOLESECTION)
  8854.  
  8855.  
  8856.         See Also:
  8857.            IniDeletePvt, IniItemize, IniRead, IniWrite
  8858.  
  8859.  
  8860.  
  8861.  
  8862.  
  8863.  
  8864.  
  8865.  
  8866.  
  8867.  
  8868.  
  8869.  
  8870.  
  8871.  
  8872.  
  8873.  
  8874.  
  8875.  
  8876.  
  8877.  
  8878.  
  8879.          ________________________________________________________________
  8880.                                                                       148
  8881.  
  8882.                                                              IniDeletePvt
  8883.          ________________________________________________________________
  8884.  
  8885.  
  8886.  
  8887.  
  8888.         IniDeletePvt
  8889.         Removes a line or section from a private INI file.
  8890.  
  8891.  
  8892.         Syntax:
  8893.          IniDeletePvt (section, keyname, filename)
  8894.  
  8895.         Parameters:
  8896.          (s) section    the major heading under which the item is located.
  8897.          (s) keyname    the name of the item to delete.
  8898.          (s) filename   name of the INI file.
  8899.  
  8900.         Returns:
  8901.          (i)            always 0.
  8902.  
  8903.         This function will remove the specified line from the specified
  8904.         section in a private INI file.  You can remove an entire section,
  8905.         instead of just a single line, by specifying a keyword of
  8906.         @WHOLESECTION.  Case is not significant in section or keyname.
  8907.  
  8908.  
  8909.         Example:
  8910.          IniDeletePvt("Current Users", "Excel", "meter.ini")
  8911.  
  8912.  
  8913.         See Also:
  8914.            IniDelete, IniItemizePvt, IniReadPvt, IniWritePvt
  8915.  
  8916.  
  8917.  
  8918.  
  8919.  
  8920.  
  8921.  
  8922.  
  8923.  
  8924.  
  8925.  
  8926.  
  8927.  
  8928.  
  8929.  
  8930.  
  8931.  
  8932.  
  8933.  
  8934.  
  8935.  
  8936.  
  8937.          ________________________________________________________________
  8938.                                                                       149
  8939.  
  8940.                                                                IniItemize
  8941.          ________________________________________________________________
  8942.  
  8943.  
  8944.  
  8945.  
  8946.         IniItemize
  8947.         Lists keywords or sections in WIN.INI.
  8948.  
  8949.  
  8950.         Syntax:
  8951.          IniItemize (section)
  8952.  
  8953.         Parameters:
  8954.          (s) section    the major heading to itemize.
  8955.  
  8956.         Returns:
  8957.          (s)            list of keywords or sections.
  8958.  
  8959.         IniItemize will scan the specified section in WIN.INI, and return a
  8960.         tab-delimited list of all keyword names contained within that
  8961.         section.  If a null string ("") is given as the section name,
  8962.         IniItemize will return a list of all section names contained within
  8963.         WIN.INI.  It returns the string "(NONE)" if the specified section
  8964.         does not exist, and returns a null string ("") if the section
  8965.         exists but is empty.  Case is not significant in section names.
  8966.  
  8967.  
  8968.         Examples:
  8969.          ; Returns all keywords in the [Extensions] section
  8970.          keywords = IniItemize("Extensions")
  8971.  
  8972.          ; Returns all sections in the entire WIN.INI file
  8973.          sections = IniItemize("")
  8974.  
  8975.  
  8976.         See Also:
  8977.            IniDelete, IniItemizePvt, IniRead, IniWrite
  8978.  
  8979.  
  8980.  
  8981.  
  8982.  
  8983.  
  8984.  
  8985.  
  8986.  
  8987.  
  8988.  
  8989.  
  8990.  
  8991.  
  8992.  
  8993.  
  8994.  
  8995.          ________________________________________________________________
  8996.                                                                       150
  8997.  
  8998.                                                             IniItemizePvt
  8999.          ________________________________________________________________
  9000.  
  9001.  
  9002.  
  9003.  
  9004.         IniItemizePvt
  9005.         Lists keywords or sections in a private INI file.
  9006.  
  9007.  
  9008.         Syntax:
  9009.          IniItemizePvt (section, filename)
  9010.  
  9011.         Parameters:
  9012.          (s) section     the major heading to itemize.
  9013.          (s) filename    name of the INI file.
  9014.  
  9015.         Returns:
  9016.          (s)             list of keywords or sections.
  9017.  
  9018.         IniItemizePvt will scan the specified section in a private INI
  9019.         file, and return a tab-delimited list of all keyword names
  9020.         contained within that section.  If a null string ("") is given as
  9021.         the section name, IniItemizePvt will return a list of all section
  9022.         names contained within the file.  It returns the string "(NONE)" if
  9023.         the specified section does not exist, and returns a null string
  9024.         ("") if the section exists but is empty.  Case is not significant
  9025.         in section names.
  9026.  
  9027.  
  9028.         Example:
  9029.          ; Returns all keywords in the [Boot] section of SYSTEM.INI
  9030.          keywords = IniItemizePvt("Boot", "system.ini")
  9031.  
  9032.  
  9033.         See Also:
  9034.            IniDeletePvt, IniItemize, IniReadPvt, IniWritePvt
  9035.  
  9036.  
  9037.  
  9038.  
  9039.  
  9040.  
  9041.  
  9042.  
  9043.  
  9044.  
  9045.  
  9046.  
  9047.  
  9048.  
  9049.  
  9050.  
  9051.  
  9052.  
  9053.          ________________________________________________________________
  9054.                                                                       151
  9055.  
  9056.                                                                   IniRead
  9057.          ________________________________________________________________
  9058.  
  9059.  
  9060.  
  9061.  
  9062.         IniRead
  9063.         Reads data from the WIN.INI file.
  9064.  
  9065.  
  9066.         Syntax:
  9067.          IniRead (section, keyname, default)
  9068.  
  9069.         Parameters:
  9070.          (s) section     the major heading to read the data from.
  9071.          (s) keyname     the name of the item to read.
  9072.          (s) default     string to return if the desired item is not found.
  9073.  
  9074.         Returns:
  9075.          (s)             data from WIN.INI file.
  9076.  
  9077.         This function allows a program to read data from the WIN.INI file.
  9078.  
  9079.         The WIN.INI file has the form:
  9080.  
  9081.            [section]
  9082.            keyname=settings
  9083.  
  9084.  
  9085.         Most of the entries in WIN.INI are set from the Windows Control
  9086.         Panel program, but individual applications can also use it to store
  9087.         option settings in their own sections.
  9088.  
  9089.  
  9090.         Example:
  9091.          ; Find the default output device
  9092.          a = IniRead("windows", "device", "No Default")
  9093.          Message("Default Output Device", a)
  9094.  
  9095.  
  9096.         See Also:
  9097.            Environment, IniDelete, IniItemize, IniReadPvt, IniWrite
  9098.  
  9099.  
  9100.  
  9101.  
  9102.  
  9103.  
  9104.  
  9105.  
  9106.  
  9107.  
  9108.  
  9109.  
  9110.  
  9111.          ________________________________________________________________
  9112.                                                                       152
  9113.  
  9114.                                                                IniReadPvt
  9115.          ________________________________________________________________
  9116.  
  9117.  
  9118.  
  9119.  
  9120.         IniReadPvt
  9121.         Reads data from a private INI file.
  9122.  
  9123.  
  9124.         Syntax:
  9125.          IniReadPvt (section, keyname, default, filename)
  9126.  
  9127.         Parameters:
  9128.          (s) section     the major heading to read the data from.
  9129.          (s) keyname     the name of the item to read.
  9130.          (s) default     string to return if the desired item is not found.
  9131.          (s) filename    name of the INI file.
  9132.  
  9133.         Returns:
  9134.          (s)             data from the INI file.
  9135.  
  9136.         Looks up a value in the "filename".INI file.  If the value is not
  9137.         found, the "default" will be returned.
  9138.  
  9139.  
  9140.         Example:
  9141.          IniReadPvt("Main", "Lang", "English", "WB.INI")
  9142.  
  9143.         Given the following segment from WB.INI:
  9144.  
  9145.            [Main]
  9146.            Lang=French
  9147.  
  9148.         The statement above would return:
  9149.  
  9150.            French
  9151.  
  9152.  
  9153.         See Also:
  9154.            Environment, IniDeletePvt, IniItemizePvt, IniRead, IniWritePvt
  9155.  
  9156.  
  9157.  
  9158.  
  9159.  
  9160.  
  9161.  
  9162.  
  9163.  
  9164.  
  9165.  
  9166.  
  9167.  
  9168.  
  9169.          ________________________________________________________________
  9170.                                                                       153
  9171.  
  9172.                                                                  IniWrite
  9173.          ________________________________________________________________
  9174.  
  9175.  
  9176.  
  9177.  
  9178.         IniWrite
  9179.         Writes data to the WIN.INI file.
  9180.  
  9181.  
  9182.         Syntax:
  9183.          IniWrite (section, keyname, data)
  9184.  
  9185.         Parameters:
  9186.          (s) section     major heading to write the data to.
  9187.          (s) keyname     name of the data item to write.
  9188.          (s) data        string to write to the WIN.INI file.
  9189.  
  9190.         Returns:
  9191.          (i)             always 1.
  9192.  
  9193.         This command allows a program to write data to the WIN.INI file.
  9194.         "section" is added to the file if it doesn't already exist.
  9195.  
  9196.  
  9197.         Example:
  9198.          ; Change the list of pgms to load upon Windows
  9199.          ; startup
  9200.          loadprogs = IniRead("windows", "load", "")
  9201.          newprogs = AskLine("Add Pgm To LOAD= Line", "Add:", loadprogs)
  9202.          IniWrite("windows", "load", newprogs)
  9203.  
  9204.  
  9205.         See Also:
  9206.            IniDelete, IniItemize, IniRead, IniWritePvt
  9207.  
  9208.  
  9209.  
  9210.  
  9211.  
  9212.  
  9213.  
  9214.  
  9215.  
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.  
  9223.  
  9224.  
  9225.  
  9226.  
  9227.          ________________________________________________________________
  9228.                                                                       154
  9229.  
  9230.                                                               IniWritePvt
  9231.          ________________________________________________________________
  9232.  
  9233.  
  9234.  
  9235.  
  9236.         IniWritePvt
  9237.         Writes data to a private INI file.
  9238.  
  9239.  
  9240.         Syntax:
  9241.          IniWritePvt (section, keyname, data, filename)
  9242.  
  9243.         Parameters:
  9244.          (s) section     major heading to write the data to.
  9245.          (s) keyname     name of the data item to write.
  9246.          (s) data        string to write to the INI file.
  9247.          (s) filename    name of the INI file.
  9248.  
  9249.         Returns:
  9250.          (i)             always 1.
  9251.  
  9252.         Writes a value in the "filename".INI file.
  9253.  
  9254.  
  9255.         Example:
  9256.          IniWritePvt("Main", "Lang", "French, "MYFILE.INI")
  9257.  
  9258.         This would create the following entry in MYFILE.INI:
  9259.  
  9260.            [Main]
  9261.            Lang=French
  9262.  
  9263.  
  9264.         See Also:
  9265.            IniDeletePvt, IniItemizePvt, IniReadPvt, IniWrite
  9266.  
  9267.  
  9268.  
  9269.  
  9270.  
  9271.  
  9272.  
  9273.  
  9274.  
  9275.  
  9276.  
  9277.  
  9278.  
  9279.  
  9280.  
  9281.  
  9282.  
  9283.  
  9284.  
  9285.          ________________________________________________________________
  9286.                                                                       155
  9287.  
  9288.                                                                IntControl
  9289.          ________________________________________________________________
  9290.  
  9291.  
  9292.  
  9293.  
  9294.         IntControl
  9295.         Internal control functions.
  9296.  
  9297.  
  9298.         Syntax:
  9299.          IntControl (request#, p1, p2, p3, p4)
  9300.  
  9301.         Parameters:
  9302.          (i) request#    specifies which sub-function is to be performed
  9303.                          (see below).
  9304.          (s) p1 - p4     parameters which may be required by the function
  9305.                          (see below).
  9306.  
  9307.         Returns:
  9308.          (s)          varies (see below).
  9309.  
  9310.         Short for Internal Control, a special function that permits
  9311.         numerous internal operations in the various products.  The first
  9312.         parameter of IntControl defines exactly what the function does, the
  9313.         other parameters are possible arguments to the function.
  9314.  
  9315.         Refer to your product documentation for any further information on
  9316.         this function.
  9317.  
  9318.         Warning: Many of these operations are useful only under special
  9319.         circumstances, and/or by technically knowledgeable users.  Some
  9320.         could lead to adverse side effects.  If it isn't clear to you what
  9321.         a particular function does, don't use it.
  9322.  
  9323.  
  9324.         IntControl (1, p1, 0, 0, 0)
  9325.         Just a test IntControl.  It echoes back P1 & P2 and P3 & P4 in a
  9326.         pair of message boxes.
  9327.  
  9328.  
  9329.         IntControl (4, p1, 0, 0, 0)
  9330.         Controls whether or not a dialog box with a file listbox in it has
  9331.         to return a file name, or may return merely a directory name or
  9332.         nothing.
  9333.  
  9334.            P1   Meaning
  9335.  
  9336.            0    May return nothing, or just a directory name
  9337.            1    Must return a file name (default)
  9338.  
  9339.  
  9340.         IntControl (5, p1, 0, 0, 0)
  9341.         Controls whether system & hidden files are seen and processed.
  9342.  
  9343.          ________________________________________________________________
  9344.                                                                       156
  9345.  
  9346.                                                                IntControl
  9347.          ________________________________________________________________
  9348.  
  9349.            P1   Meaning
  9350.  
  9351.            0    System & Hidden files not used (default)
  9352.            1    System & Hidden files seen and used
  9353.  
  9354.  
  9355.         IntControl (10, p1, 0, 0, 0)
  9356.         Interrogates the Command Extender DLL status
  9357.  
  9358.            P1   Meaning
  9359.  
  9360.            0    Command Extender present
  9361.                 0     No
  9362.                 1     Yes
  9363.  
  9364.            1    Command Extender version
  9365.                 -1      No Extender present
  9366.                  0      Incompatible extender present
  9367.                 (other) Extender version code
  9368.  
  9369.            2    Interpreter's Extender interface code
  9370.  
  9371.            3    Name of Extender DLL
  9372.  
  9373.  
  9374.         IntControl (20, 0, 0, 0, 0)
  9375.         Returns window handle of current parent window.
  9376.  
  9377.  
  9378.         IntControl (21, p1, 0, 0, 0)
  9379.         Returns window handle of window matching the partial window-name in
  9380.         p1.
  9381.  
  9382.  
  9383.         IntControl (22, p1, p2, p3, p4)
  9384.         Issues a Windows "SendMessage".
  9385.  
  9386.            p1   Window handle to send to
  9387.            p2   Message ID number (in decimal)
  9388.            p3   wParam value
  9389.            p4   assumed to be a character string.  String is copied to a
  9390.                 GMEM_LOWER buffer, and a LPSTR to the copied string is
  9391.                 passed as lParam. The GMEM_LOWER buffer is freed
  9392.                 immediately upon return from the SendMessage
  9393.  
  9394.  
  9395.         IntControl (23, 0, 0, 0, 0)
  9396.         Issues a windows PostMessage
  9397.  
  9398.            p1   Window handle
  9399.            p2   Message ID number (in decimal)
  9400.  
  9401.          ________________________________________________________________
  9402.                                                                       157
  9403.  
  9404.                                                                IntControl
  9405.          ________________________________________________________________
  9406.  
  9407.            p3   wParam
  9408.            p4   lParam  ---
  9409.  
  9410.  
  9411.         IntControl (26, 0, 0, 0, 0)
  9412.         Re-assesses the language currently being used (using the method
  9413.         described in WWWDLANG.DLL), and makes any necessary changes to the
  9414.         language strings used by the WIL Interpreter.  Normally, this is
  9415.         done by default at program startup.
  9416.  
  9417.  
  9418.         IntControl (66, 0, 0, 0, 0)
  9419.         Restarts Windows, just like exiting to DOS and typing WIN again.
  9420.         Could be used to restart Windows after editing the SYSTEM.INI file
  9421.         to change video modes.
  9422.  
  9423.  
  9424.         IntControl (67, 0, 0, 0, 0)
  9425.         Performs a warm boot of the system, just like <Ctrl-Alt-Del>.
  9426.         Could be used to reboot the system after editing the AUTOEXEC.BAT
  9427.         or CONFIG.SYS files.
  9428.  
  9429.         Note: IntControl(67) requires Windows 3.1 or higher.  Under Windows
  9430.         3.0, it behaves just like IntControl(66) and restarts Windows.
  9431.  
  9432.  
  9433.  
  9434.  
  9435.  
  9436.  
  9437.  
  9438.  
  9439.  
  9440.  
  9441.  
  9442.  
  9443.  
  9444.  
  9445.  
  9446.  
  9447.  
  9448.  
  9449.  
  9450.  
  9451.  
  9452.  
  9453.  
  9454.  
  9455.  
  9456.  
  9457.  
  9458.  
  9459.          ________________________________________________________________
  9460.                                                                       158
  9461.  
  9462.                                                                 IsDefined
  9463.          ________________________________________________________________
  9464.  
  9465.  
  9466.  
  9467.  
  9468.         IsDefined
  9469.         Determines if a variable name is currently defined.
  9470.  
  9471.  
  9472.         Syntax:
  9473.          IsDefined (var)
  9474.  
  9475.         Parameters:
  9476.          (s) var      a variable name.
  9477.  
  9478.         Returns:
  9479.          (i)          @YES if the variable is currently defined;
  9480.                       @NO if it was never defined or has been dropped.
  9481.  
  9482.         A variable is defined the first time it appears to the left of an
  9483.         equal sign in a statement.  It stays defined until it is explicitly
  9484.         dropped with the Drop function, or until the current invocation of
  9485.         the WIL Interpreter gets closed.
  9486.  
  9487.         Generally speaking: in batch file-based implementations of WIL, all
  9488.         variables are dropped automatically at the end of every batch file;
  9489.         and in menu-based implementations of WIL, variables stay defined
  9490.         until explicitly dropped.
  9491.  
  9492.  
  9493.         Example:
  9494.          def = IsDefined(thisvar)
  9495.          If def == @FALSE Then Message("ERROR!", "Variable not defined")
  9496.  
  9497.  
  9498.         See Also:
  9499.            Drop
  9500.  
  9501.  
  9502.  
  9503.  
  9504.  
  9505.  
  9506.  
  9507.  
  9508.  
  9509.  
  9510.  
  9511.  
  9512.  
  9513.  
  9514.  
  9515.  
  9516.  
  9517.          ________________________________________________________________
  9518.                                                                       159
  9519.  
  9520.                                                                 IsKeyDown
  9521.          ________________________________________________________________
  9522.  
  9523.  
  9524.  
  9525.  
  9526.         IsKeyDown
  9527.         Tells about keys/mouse.
  9528.  
  9529.         Syntax:
  9530.          IsKeyDown(keycodes)
  9531.  
  9532.         Parameters:
  9533.          (i) keycodes    @SHIFT and/or @CTRL.
  9534.  
  9535.         Returns:
  9536.          (i)             @YES if the key is down;
  9537.                          @NO if the key is not down.
  9538.  
  9539.  
  9540.         Determines if the Shift key or the Ctrl key is currently down.
  9541.  
  9542.         Note: The right mouse button is the same as Shift, and the middle
  9543.         mouse button is the same as Ctrl.
  9544.  
  9545.  
  9546.         Examples:
  9547.          IsKeyDown(@SHIFT)
  9548.  
  9549.          IsKeyDown(@CTRL)
  9550.  
  9551.          IsKeyDown(@CTRL | @SHIFT)
  9552.  
  9553.          IsKeyDown(@CTRL & @SHIFT)
  9554.  
  9555.  
  9556.         See Also:
  9557.            WaitForKey
  9558.  
  9559.  
  9560.  
  9561.  
  9562.  
  9563.  
  9564.  
  9565.  
  9566.  
  9567.  
  9568.  
  9569.  
  9570.  
  9571.  
  9572.  
  9573.  
  9574.  
  9575.          ________________________________________________________________
  9576.                                                                       160
  9577.  
  9578.                                                                IsLicensed
  9579.          ________________________________________________________________
  9580.  
  9581.  
  9582.  
  9583.  
  9584.         IsLicensed
  9585.         Tells if the calling application is licensed.
  9586.  
  9587.  
  9588.         Syntax:
  9589.          IsLicensed ( )
  9590.  
  9591.         Parameters:
  9592.          (none)
  9593.  
  9594.         Returns:
  9595.          (i)          @YES if it is licensed;
  9596.                       @NO if it is not licensed.
  9597.  
  9598.  
  9599.         Returns information on whether or not the currently-running version
  9600.         of the calling application is a licensed copy.
  9601.  
  9602.  
  9603.         Example:
  9604.          IsLicensed()
  9605.  
  9606.  
  9607.         See Also:
  9608.            Version
  9609.  
  9610.  
  9611.  
  9612.  
  9613.  
  9614.  
  9615.  
  9616.  
  9617.  
  9618.  
  9619.  
  9620.  
  9621.  
  9622.  
  9623.  
  9624.  
  9625.  
  9626.  
  9627.  
  9628.  
  9629.  
  9630.  
  9631.  
  9632.  
  9633.          ________________________________________________________________
  9634.                                                                       161
  9635.  
  9636.                                                        IsMenuChecked {*M}
  9637.          ________________________________________________________________
  9638.  
  9639.  
  9640.  
  9641.  
  9642.         IsMenuChecked {*M}
  9643.         Determines if a menu item has a checkmark next to it.
  9644.  
  9645.  
  9646.         Syntax:
  9647.          IsMenuChecked (menuname)
  9648.  
  9649.         Parameters:
  9650.          (s) menuname   name of the menu item to test.
  9651.  
  9652.         Returns:
  9653.          (i)            @YES if the menu item has a checkmark;
  9654.                         @NO if it doesn't.
  9655.  
  9656.         You can place a checkmark next to a menu item with the MenuChange
  9657.         command, to indicate an option has been enabled.  This function
  9658.         lets you determine if the menu item has already been checked or
  9659.         not.
  9660.  
  9661.         Note: This command is not part of the WIL Interpreter package, but
  9662.         is documented here because it has been implemented in many of the
  9663.         shell or file manager-type applications which use the WIL
  9664.         Interpreter.
  9665.  
  9666.  
  9667.         Example:
  9668.          ; assume we've defined a "Misc | Prompt Often" menu item
  9669.          prompt = IsMenuChecked("MiscPromptOften")
  9670.          ifprompt = SubStr(";", 1, (prompt == @FALSE))
  9671.          Execute %ifprompt% confirm = AskYesNo("???", "REALLY do this?")
  9672.          ; some risky operation the user has just confirmed they want to do
  9673.          Execute %ifprompt% Terminate(confirm != @YES, "", "")
  9674.  
  9675.  
  9676.         See Also:
  9677.            IsMenuEnabled, MenuChange
  9678.  
  9679.  
  9680.  
  9681.  
  9682.  
  9683.  
  9684.  
  9685.  
  9686.  
  9687.  
  9688.  
  9689.  
  9690.  
  9691.          ________________________________________________________________
  9692.                                                                       162
  9693.  
  9694.                                                        IsMenuEnabled {*M}
  9695.          ________________________________________________________________
  9696.  
  9697.  
  9698.  
  9699.  
  9700.         IsMenuEnabled {*M}
  9701.         Determines if a menu item has been enabled.
  9702.  
  9703.  
  9704.         Syntax:
  9705.          IsMenuEnabled (menuname)
  9706.  
  9707.         Parameters:
  9708.          (s) menuname name of the menu item to test.
  9709.  
  9710.         Returns:
  9711.          (i)          @YES if the menu item is enabled;
  9712.                       @NO if it is disabled & grayed.
  9713.  
  9714.         You can disable a menu item with the MenuChange command if you want
  9715.         to prevent the user from choosing it.  It shows up on the screen as
  9716.         a grayed item.  IsMenuEnabled lets you determine if the menu item
  9717.         is currently enabled or not.
  9718.  
  9719.         Note: This command is not part of the WIL Interpreter package, but
  9720.         is documented here because it has been implemented in many of the
  9721.         shell or file manager-type applications which use the WIL
  9722.         Interpreter.
  9723.  
  9724.  
  9725.         Example:
  9726.          ; allow editing of autoexec.bat file only if choice enabled
  9727.          Terminate(!IsMenuEnabled("UtilitiesEditBatFile"), "", "")
  9728.          Run("notepad.exe", "c:\autoexec.bat")
  9729.  
  9730.  
  9731.         See Also:
  9732.            IsMenuChecked, MenuChange
  9733.  
  9734.  
  9735.  
  9736.  
  9737.  
  9738.  
  9739.  
  9740.  
  9741.  
  9742.  
  9743.  
  9744.  
  9745.  
  9746.  
  9747.  
  9748.  
  9749.          ________________________________________________________________
  9750.                                                                       163
  9751.  
  9752.                                                                  IsNumber
  9753.          ________________________________________________________________
  9754.  
  9755.  
  9756.  
  9757.  
  9758.         IsNumber
  9759.         Determines whether a variable contains a valid number.
  9760.  
  9761.  
  9762.         Syntax:
  9763.          IsNumber (string)
  9764.  
  9765.         Parameters:
  9766.          (s) string   string to test to see if it represents a valid
  9767.                       number.
  9768.  
  9769.         Returns:
  9770.          (i)          @YES if it contains a valid number;
  9771.                       @NO if it doesn't.
  9772.  
  9773.         This function determines if a string variable contains a valid
  9774.         integer.  Useful for checking user input prior to using it in
  9775.         computations.
  9776.  
  9777.  
  9778.         Example:
  9779.          a = AskLine("ISNUMBER", "Enter a number", "0")
  9780.          If IsNumber(a) == @NO Then Message("", "You didn't enter a
  9781.              number")
  9782.  
  9783.  
  9784.         See Also:
  9785.            Abs, Char2Num, Num2Char
  9786.  
  9787.  
  9788.  
  9789.  
  9790.  
  9791.  
  9792.  
  9793.  
  9794.  
  9795.  
  9796.  
  9797.  
  9798.  
  9799.  
  9800.  
  9801.  
  9802.  
  9803.  
  9804.  
  9805.  
  9806.  
  9807.          ________________________________________________________________
  9808.                                                                       164
  9809.  
  9810.                                                                 ItemCount
  9811.          ________________________________________________________________
  9812.  
  9813.  
  9814.  
  9815.  
  9816.         ItemCount
  9817.         Returns the number of items in a list.
  9818.  
  9819.  
  9820.         Syntax:
  9821.          ItemCount (list, delimiter)
  9822.  
  9823.         Parameters:
  9824.          (s) list         a string containing a list of items.
  9825.          (s) delimiter    a character to act as a delimiter between items
  9826.                           in the list.
  9827.  
  9828.         Returns:
  9829.          (i)              the number of items in the list.
  9830.  
  9831.         If you create the list with the FileItemize or DirItemize functions
  9832.         you will be using a space-delimited list.  WinItemize, however,
  9833.         creates a tab-delimited list of window titles since titles can have
  9834.         embedded spaces.
  9835.  
  9836.  
  9837.         Example:
  9838.          a = FileItemize("*.*")
  9839.          n = ItemCount(a, " ")
  9840.          Message("Note", "There are %n% files")
  9841.  
  9842.  
  9843.         See Also:
  9844.            ItemExtract, ItemSelect
  9845.  
  9846.  
  9847.  
  9848.  
  9849.  
  9850.  
  9851.  
  9852.  
  9853.  
  9854.  
  9855.  
  9856.  
  9857.  
  9858.  
  9859.  
  9860.  
  9861.  
  9862.  
  9863.  
  9864.  
  9865.          ________________________________________________________________
  9866.                                                                       165
  9867.  
  9868.                                                               ItemExtract
  9869.          ________________________________________________________________
  9870.  
  9871.  
  9872.  
  9873.  
  9874.         ItemExtract
  9875.         Returns the selected item from a list.
  9876.  
  9877.  
  9878.         Syntax:
  9879.          ItemExtract (index, list, delimiter)
  9880.  
  9881.         Parameters:
  9882.          (i) index        the position in list of the item to be selected.
  9883.          (s) list         a string containing a list of items.
  9884.          (s) delimiter    a character to act as a delimiter between items
  9885.                           in the list.
  9886.  
  9887.         Returns:
  9888.          (s)              the selected item.
  9889.  
  9890.         If you create the list with the FileItemize or DirItemize functions
  9891.         you will be using a space-delimited list.  WinItemize, however,
  9892.         creates a tab-delimited list of window titles since titles can have
  9893.         embedded blanks.
  9894.  
  9895.  
  9896.         Example:
  9897.          bmpfiles = FileItemize("*.bmp")
  9898.          bmpcount = ItemCount(bmpfiles, " ")
  9899.          pos = (Random(bmpcount - 1)) + 1
  9900.          paper = ItemExtract(pos, bmpfiles, " ")
  9901.          Wallpaper(paper, @FALSE)
  9902.  
  9903.  
  9904.         See Also:
  9905.            ItemCount, ItemLocate, ItemSelect, ItemSort
  9906.  
  9907.  
  9908.  
  9909.  
  9910.  
  9911.  
  9912.  
  9913.  
  9914.  
  9915.  
  9916.  
  9917.  
  9918.  
  9919.  
  9920.  
  9921.  
  9922.  
  9923.          ________________________________________________________________
  9924.                                                                       166
  9925.  
  9926.                                                                ItemInsert
  9927.          ________________________________________________________________
  9928.  
  9929.  
  9930.  
  9931.  
  9932.         ItemInsert
  9933.         Adds an item to a list.
  9934.  
  9935.  
  9936.         Syntax:
  9937.          ItemInsert (item, index, list, delimiter)
  9938.  
  9939.         Parameters:
  9940.          (s) item         a new item to add to list.
  9941.          (i) index        the position in list after which the item will be
  9942.                           inserted.
  9943.          (s) list         a string containing a list of items.
  9944.          (s) delimiter    a character to act as a delimiter between items
  9945.                           in the list.
  9946.  
  9947.         Returns:
  9948.          (s)              new list, with item inserted.
  9949.  
  9950.         This function inserts a new item into an existing list, at the
  9951.         position following index.  It returns a new list, with the
  9952.         specified item inserted; the original list (list) is unchanged.
  9953.         For example, specifying an index of 1 causes the new item to be
  9954.         inserted after the first item in the list; i.e., the new item
  9955.         becomes the second item in the list.
  9956.  
  9957.         You can specify an index of 0 to add the item to the beginning of
  9958.         the list, and an index of -1 to append the item to the end of the
  9959.         list.
  9960.  
  9961.         If you create the list with the FileItemize or DirItemize functions
  9962.         you will be using a space-delimited list.  WinItemize, however,
  9963.         creates a tab-delimited list of window titles since titles can have
  9964.         embedded blanks.
  9965.  
  9966.  
  9967.         Example:
  9968.          newlist = ItemInsert(item, index, list, delimiter)
  9969.  
  9970.  
  9971.         See Also:
  9972.            ItemCount, ItemRemove
  9973.  
  9974.  
  9975.  
  9976.  
  9977.  
  9978.  
  9979.  
  9980.  
  9981.          ________________________________________________________________
  9982.                                                                       167
  9983.  
  9984.                                                                ItemLocate
  9985.          ________________________________________________________________
  9986.  
  9987.  
  9988.  
  9989.  
  9990.         ItemLocate
  9991.         Returns the position of an item in a list.
  9992.  
  9993.  
  9994.         Syntax:
  9995.          ItemLocate (item, list, delimiter)
  9996.  
  9997.         Parameters:
  9998.          (s) item         item to search for in list.
  9999.          (s) list         a string containing a list of items.
  10000.          (s) delimiter    a character to act as a delimiter between items
  10001.                           in the list.
  10002.  
  10003.         Returns:
  10004.          (i)              position in list of item, or 0 if no match found.
  10005.  
  10006.         This function finds the first occurrence of item in the specified
  10007.         list, and returns the position of the item (the first item in a
  10008.         list has a position of 1).  If the item is not found, the function
  10009.         will return a 0.
  10010.  
  10011.         If you create the list with the FileItemize or DirItemize functions
  10012.         you will be using a space-delimited list.  WinItemize, however,
  10013.         creates a tab-delimited list of window titles since titles can have
  10014.         embedded blanks.
  10015.  
  10016.  
  10017.         Example:
  10018.          ItemLocate(item, list, delimiter)
  10019.  
  10020.  
  10021.         See Also:
  10022.            ItemExtract
  10023.  
  10024.  
  10025.  
  10026.  
  10027.  
  10028.  
  10029.  
  10030.  
  10031.  
  10032.  
  10033.  
  10034.  
  10035.  
  10036.  
  10037.  
  10038.  
  10039.          ________________________________________________________________
  10040.                                                                       168
  10041.  
  10042.                                                                ItemRemove
  10043.          ________________________________________________________________
  10044.  
  10045.  
  10046.  
  10047.  
  10048.         ItemRemove
  10049.         Removes an item from a list.
  10050.  
  10051.  
  10052.         Syntax:
  10053.          ItemRemove (index, list, delimiter)
  10054.  
  10055.         Parameters:
  10056.          (i) index       the position in list of the item to be removed.
  10057.          (s) list        a string containing a list of items.
  10058.          (s) delimiter   a character to act as a delimiter between items in
  10059.                          the list.
  10060.  
  10061.         Returns:
  10062.          (s)             new list, with item removed.
  10063.  
  10064.         This function removes the item at the position specified by index
  10065.         from a list.  The delimiter following the item is removed as well.
  10066.         It returns a new list, with the specified item removed; the
  10067.         original list (list) is unchanged.
  10068.  
  10069.         If you create the list with the FileItemize or DirItemize functions
  10070.         you will be using a space-delimited list.  WinItemize, however,
  10071.         creates a tab-delimited list of window titles since titles can have
  10072.         embedded spaces.
  10073.  
  10074.  
  10075.         Example:
  10076.          newlist = ItemRemove(index, list, delimiter)
  10077.  
  10078.  
  10079.         See Also:
  10080.            ItemCount, ItemInsert
  10081.  
  10082.  
  10083.  
  10084.  
  10085.  
  10086.  
  10087.  
  10088.  
  10089.  
  10090.  
  10091.  
  10092.  
  10093.  
  10094.  
  10095.  
  10096.  
  10097.          ________________________________________________________________
  10098.                                                                       169
  10099.  
  10100.                                                                ItemSelect
  10101.          ________________________________________________________________
  10102.  
  10103.  
  10104.  
  10105.  
  10106.         ItemSelect
  10107.         Allows the user to choose an item from a listbox.
  10108.  
  10109.  
  10110.         Syntax:
  10111.          ItemSelect (title, list, delimiter)
  10112.  
  10113.         Parameters:
  10114.          (s) title       the title of the dialog box to display.
  10115.          (s) list        a string containing a list of items.
  10116.          (s) delimiter   a character to act as a delimiter between items in
  10117.                          the list.
  10118.  
  10119.         Returns:
  10120.          (s)             the selected item.
  10121.  
  10122.         This function displays a dialog box with a listbox inside.  This
  10123.         listbox is filled with a sorted list of items taken from a string
  10124.         you provide to the function.
  10125.  
  10126.         Each item in the string must be separated ("delimited") by a
  10127.         character, which you also pass to the function.
  10128.  
  10129.         The user selects one of the items by either doubleclicking on it,
  10130.         or single-clicking and pressing OK.  The item is returned as a
  10131.         string.
  10132.  
  10133.         If you create the list with the FileItemize or DirItemize functions
  10134.         you will be using a space-delimited list.  WinItemize, however,
  10135.         creates a tab-delimited list of window titles since titles can have
  10136.         embedded spaces.
  10137.  
  10138.  
  10139.         Example:
  10140.          DirChange("c:\winword")
  10141.          alldotfiles = FileItemize("*.dot")
  10142.          dotfile = ItemSelect("W4W Templates", alldotfiles, " ")
  10143.          Run("winword.exe", dotfile)
  10144.  
  10145.         Which would produce:
  10146.  
  10147.  
  10148.  
  10149.  
  10150.  
  10151.  
  10152.  
  10153.  
  10154.  
  10155.          ________________________________________________________________
  10156.                                                                       170
  10157.  
  10158.                                                                ItemSelect
  10159.          ________________________________________________________________
  10160.  
  10161.               ....................................................
  10162.               .                    W4W Templates                 .
  10163.               ....................................................
  10164.               .    ____________________________________________  .
  10165.               .   |  WINBATCH.DOT                           |^|  .
  10166.               .   |  CMDPOST.DOT                            |x|  .
  10167.               .   |  SYSINI.DOT                             |x|  .
  10168.               .   |  SYSINI2.DOT                            |x|  .
  10169.               .   |  WININI.DOT                             |x|  .
  10170.               .   |  WININI2.DOT                            |x|  .
  10171.               .   |  NEWSTUFF.DOT                           |x|  .
  10172.               .   |  NORMAL.DOT                             |x|  .
  10173.               .   |_________________________________________|v|  .
  10174.               .                                                  .
  10175.               .       [OK]                      [Cancel]         .
  10176.               ....................................................
  10177.  
  10178.  
  10179.         See Also:
  10180.            AskYesNo, Dialog, DirItemize, Display, FileItemize, ItemCount,
  10181.            ItemExtract, Message, Pause, TextBox, TextBoxSort, TextSelect,
  10182.            WinItemize
  10183.  
  10184.  
  10185.  
  10186.  
  10187.  
  10188.  
  10189.  
  10190.  
  10191.  
  10192.  
  10193.  
  10194.  
  10195.  
  10196.  
  10197.  
  10198.  
  10199.  
  10200.  
  10201.  
  10202.  
  10203.  
  10204.  
  10205.  
  10206.  
  10207.  
  10208.  
  10209.  
  10210.  
  10211.  
  10212.  
  10213.          ________________________________________________________________
  10214.                                                                       171
  10215.  
  10216.                                                                  ItemSort
  10217.          ________________________________________________________________
  10218.  
  10219.  
  10220.  
  10221.  
  10222.         ItemSort
  10223.         Sorts a list.
  10224.  
  10225.  
  10226.         Syntax:
  10227.          ItemSort (list, delimiter)
  10228.  
  10229.         Parameters:
  10230.          (s) list        a string containing a list of items.
  10231.          (s) delimiter   a character to act as a delimiter between items in
  10232.                          the list.
  10233.  
  10234.         Returns:
  10235.          (s)             new, sorted list.
  10236.  
  10237.         This function sorts a list, using an ANSI sort sequence.  It
  10238.         returns a new, sorted list; the original list is unchanged.
  10239.  
  10240.         If you create the list with the FileItemize or DirItemize functions
  10241.         you will be using a space-delimited list.  WinItemize, however,
  10242.         creates a tab-delimited list of window titles since titles can have
  10243.         embedded spaces.
  10244.  
  10245.  
  10246.         Example:
  10247.          newlist = ItemSort(list, delimiter)
  10248.  
  10249.  
  10250.         See Also:
  10251.            ItemExtract
  10252.  
  10253.  
  10254.  
  10255.  
  10256.  
  10257.  
  10258.  
  10259.  
  10260.  
  10261.  
  10262.  
  10263.  
  10264.  
  10265.  
  10266.  
  10267.  
  10268.  
  10269.  
  10270.  
  10271.          ________________________________________________________________
  10272.                                                                       172
  10273.  
  10274.                                                                 LastError
  10275.          ________________________________________________________________
  10276.  
  10277.  
  10278.  
  10279.  
  10280.         LastError
  10281.         Returns the most-recent error encountered during the current WIL
  10282.         program.
  10283.  
  10284.  
  10285.         Syntax:
  10286.          LastError ( )
  10287.  
  10288.         Parameters:
  10289.          (none)
  10290.  
  10291.         Returns:
  10292.          (i)          most-recent WIL error code encountered.
  10293.  
  10294.         WIL errors are numbered according to their severity.  "Minor"
  10295.         errors go from 1000 through 1999.  Moderate errors are 2000 through
  10296.         2999.  Fatal errors are numbered 3000 to 3999.
  10297.  
  10298.         Depending on which error mode is active when an error occurs, you
  10299.         may not get a chance to check the error code.  See ErrorMode for a
  10300.         discussion of default error handling.
  10301.  
  10302.         Don't bother checking for "fatal" error codes.  When a fatal error
  10303.         occurs, the WIL program is canceled before the next WIL statement
  10304.         gets to execute (regardless of which error mode is active).
  10305.  
  10306.         Every time the LastError function is called, the "last error"
  10307.         indicator is reset to zero.
  10308.  
  10309.         A full listing of possible errors you can encounter in processing a
  10310.         WIL program is in Appendix B (pg. 279).
  10311.  
  10312.  
  10313.         Example:
  10314.          ErrorMode(@OFF)
  10315.          FileCopy("data.dat", "c:\backups", @FALSE)
  10316.          ErrorMode(@CANCEL)
  10317.          If LastError() == 1006 Then Message("Error", "Please call  Tech
  10318.          Support at 555-9999.")
  10319.  
  10320.  
  10321.         See Also:
  10322.            Debug, ErrorMode
  10323.  
  10324.  
  10325.  
  10326.  
  10327.  
  10328.  
  10329.          ________________________________________________________________
  10330.                                                                       173
  10331.  
  10332.                                                                   LogDisk
  10333.          ________________________________________________________________
  10334.  
  10335.  
  10336.  
  10337.  
  10338.         LogDisk
  10339.         Logs (activates) a disk drive.
  10340.  
  10341.  
  10342.         Syntax:
  10343.          LogDisk (drive-letter)
  10344.  
  10345.         Parameters:
  10346.          (s) drive-letter   the disk drive to log into.
  10347.  
  10348.         Returns:
  10349.          (i)                @TRUE if the current drive was changed;
  10350.                             @FALSE if the drive doesn't exist.
  10351.  
  10352.         Use this function to change to a different disk drive.
  10353.  
  10354.  
  10355.         Example:
  10356.          LogDisk("c:")
  10357.  
  10358.  
  10359.         See Also:
  10360.            DirChange, DiskScan
  10361.  
  10362.  
  10363.  
  10364.  
  10365.  
  10366.  
  10367.  
  10368.  
  10369.  
  10370.  
  10371.  
  10372.  
  10373.  
  10374.  
  10375.  
  10376.  
  10377.  
  10378.  
  10379.  
  10380.  
  10381.  
  10382.  
  10383.  
  10384.  
  10385.  
  10386.  
  10387.          ________________________________________________________________
  10388.                                                                       174
  10389.  
  10390.                                                                       Max
  10391.          ________________________________________________________________
  10392.  
  10393.  
  10394.  
  10395.  
  10396.         Max
  10397.         Returns largest number in a list of numbers.
  10398.  
  10399.  
  10400.         Syntax:
  10401.          Max (integer [, integer...])
  10402.  
  10403.         Parameters:
  10404.          (i) integer  an integer number.
  10405.  
  10406.         Returns:
  10407.          (i)          largest parameter.
  10408.  
  10409.         Use this function to determine the largest of a set of comma-
  10410.         delimited integers.
  10411.  
  10412.  
  10413.         Example:
  10414.          a = Max(5, -37, 125, 34, 2345, -32767)
  10415.          Message("Largest number is", a)
  10416.  
  10417.  
  10418.         See Also:
  10419.            Abs, Average, Min, Random
  10420.  
  10421.  
  10422.  
  10423.  
  10424.  
  10425.  
  10426.  
  10427.  
  10428.  
  10429.  
  10430.  
  10431.  
  10432.  
  10433.  
  10434.  
  10435.  
  10436.  
  10437.  
  10438.  
  10439.  
  10440.  
  10441.  
  10442.  
  10443.  
  10444.  
  10445.          ________________________________________________________________
  10446.                                                                       175
  10447.  
  10448.                                                           MenuChange {*M}
  10449.          ________________________________________________________________
  10450.  
  10451.  
  10452.  
  10453.  
  10454.         MenuChange {*M}
  10455.         Checks, unchecks, enables, or disables a menu item.
  10456.  
  10457.  
  10458.         Syntax:
  10459.          MenuChange (menuname, flags)
  10460.  
  10461.         Parameters:
  10462.          (s) menuname    menu item whose status you wish to change.
  10463.          (s) flags       @CHECK, @UNCHECK, @ENABLE, or @DISABLE.
  10464.  
  10465.         Returns:
  10466.          (i)          always 1.
  10467.  
  10468.         There are currently two ways you can modify a menu item:
  10469.  
  10470.         You can check and uncheck the item to imply that it corresponds to
  10471.         an option that can be turned on or off.
  10472.  
  10473.         You can temporarily disable the item (it shows up as gray) and
  10474.         later re-enable it.
  10475.  
  10476.         The two sets of flags (@Check/@UnCheck and @Enable/@Disable) can be
  10477.         combined in one function call by using the | (or) operator.
  10478.  
  10479.         Note: This command is not part of the WIL Interpreter package, but
  10480.         is documented here because it has been implemented in many of the
  10481.         shell or file manager-type applications which use the WIL
  10482.         Interpreter.
  10483.  
  10484.  
  10485.         Example:
  10486.          MenuChange("FilePrint", @Disable)
  10487.          MenuChange("WPWrite", @Enable | @Check)
  10488.  
  10489.  
  10490.         See Also:
  10491.            IsMenuChecked, IsMenuEnabled
  10492.  
  10493.  
  10494.  
  10495.  
  10496.  
  10497.  
  10498.  
  10499.  
  10500.  
  10501.  
  10502.  
  10503.          ________________________________________________________________
  10504.                                                                       176
  10505.  
  10506.                                                                   Message
  10507.          ________________________________________________________________
  10508.  
  10509.  
  10510.  
  10511.  
  10512.         Message
  10513.         Displays a message to the user.
  10514.  
  10515.  
  10516.         Syntax:
  10517.          Message (title, text)
  10518.  
  10519.         Parameters:
  10520.          (s) title    title of the message box.
  10521.          (s) text     text to display in the message box.
  10522.  
  10523.         Returns:
  10524.          (i)          always 1.
  10525.  
  10526.         Use this function to display a message to the user.  The user must
  10527.         respond by selecting the OK button before processing will continue.
  10528.  
  10529.  
  10530.         Example:
  10531.          Message("Current directory is", DirGet())
  10532.  
  10533.         which produces:
  10534.  
  10535.               ...............................
  10536.               .     Current directory is    .
  10537.               ...............................
  10538.               .                             .
  10539.               .         C:\WINDOWS          .
  10540.               .                             .
  10541.               .            [OK]             .
  10542.               ...............................
  10543.  
  10544.  
  10545.         See Also:
  10546.            Display, Pause
  10547.  
  10548.  
  10549.  
  10550.  
  10551.  
  10552.  
  10553.  
  10554.  
  10555.  
  10556.  
  10557.  
  10558.  
  10559.  
  10560.  
  10561.          ________________________________________________________________
  10562.                                                                       177
  10563.  
  10564.                                                                       Min
  10565.          ________________________________________________________________
  10566.  
  10567.  
  10568.  
  10569.  
  10570.         Min
  10571.         Returns lowest number in a list of numbers.
  10572.  
  10573.  
  10574.         Syntax:
  10575.          Min (integer [, integer...])
  10576.  
  10577.         Parameters:
  10578.          (i) integer  an integer number.
  10579.  
  10580.         Returns:
  10581.          (i)          lowest parameter.
  10582.  
  10583.         Use this function to determine the lowest of a set of comma-
  10584.         delimited integers.
  10585.  
  10586.  
  10587.         Example:
  10588.          a = Min( 5, -37, 125, 34, 2345, -32767)
  10589.          Message("Smallest number is", a)
  10590.  
  10591.  
  10592.         See Also:
  10593.            Abs, Average, Max, Random
  10594.  
  10595.  
  10596.  
  10597.  
  10598.  
  10599.  
  10600.  
  10601.  
  10602.  
  10603.  
  10604.  
  10605.  
  10606.  
  10607.  
  10608.  
  10609.  
  10610.  
  10611.  
  10612.  
  10613.  
  10614.  
  10615.  
  10616.  
  10617.  
  10618.  
  10619.          ________________________________________________________________
  10620.                                                                       178
  10621.  
  10622.                                                                 MouseInfo
  10623.          ________________________________________________________________
  10624.  
  10625.  
  10626.  
  10627.  
  10628.         MouseInfo
  10629.         Returns assorted mouse information.
  10630.  
  10631.  
  10632.         Syntax:
  10633.          MouseInfo (request#)
  10634.  
  10635.         Parameters:
  10636.          (i) request#   see below.
  10637.  
  10638.         Returns:
  10639.          (s)            see below.
  10640.  
  10641.         The information returned by MouseInfo depends on the value of
  10642.         request#.
  10643.  
  10644.            Req# Return value
  10645.  
  10646.            0    Window name under mouse
  10647.            1    Top level parent window name under mouse
  10648.            2    Mouse coordinates, assuming a 1000x1000 virtual screen
  10649.            3    Mouse coordinates in absolute numbers
  10650.            4    Status of mouse buttons, as a bitmask:
  10651.  
  10652.                   BinaryDecimal  Meaning
  10653.  
  10654.                   000   0      No buttons down
  10655.                   001   1      Right button down
  10656.                   010   2      Middle button down
  10657.                   011   3      Right and Middle buttons down
  10658.                   100   4      Left button down
  10659.                   101   5      Left and Right buttons down
  10660.                   110   6      Left and Middle buttons down
  10661.                   111   7      Left, Middle, and Right buttons down
  10662.  
  10663.         For example, if mouse is at the center of a 640x480 screen and
  10664.         above the "Clock" window, and the left button is down, the
  10665.         following values would be returned:
  10666.  
  10667.            Req# Return value
  10668.  
  10669.            1    "Clock"
  10670.            2    "500 500"
  10671.            3    "320 240"
  10672.            4    "4"
  10673.  
  10674.  
  10675.  
  10676.  
  10677.          ________________________________________________________________
  10678.                                                                       179
  10679.  
  10680.                                                                 MouseInfo
  10681.          ________________________________________________________________
  10682.  
  10683.  
  10684.         Example:
  10685.          Display(1, "", "Press a mouse button to continue")
  10686.          :loop
  10687.          buttons = MouseInfo(4)
  10688.          If buttons == 0 Then Goto loop
  10689.          If buttons & 4 Then Display(1, "", "Left button was pressed")
  10690.          If buttons & 1 Then Display(1, "", "Right button was pressed")
  10691.  
  10692.  
  10693.         See Also:
  10694.            WinMetrics, WinParmGet
  10695.  
  10696.  
  10697.  
  10698.  
  10699.  
  10700.  
  10701.  
  10702.  
  10703.  
  10704.  
  10705.  
  10706.  
  10707.  
  10708.  
  10709.  
  10710.  
  10711.  
  10712.  
  10713.  
  10714.  
  10715.  
  10716.  
  10717.  
  10718.  
  10719.  
  10720.  
  10721.  
  10722.  
  10723.  
  10724.  
  10725.  
  10726.  
  10727.  
  10728.  
  10729.  
  10730.  
  10731.  
  10732.  
  10733.  
  10734.  
  10735.          ________________________________________________________________
  10736.                                                                       180
  10737.  
  10738.                                                                 NetAddCon
  10739.          ________________________________________________________________
  10740.  
  10741.  
  10742.  
  10743.  
  10744.         NetAddCon
  10745.         Connects network resources to imaginary local disk drives or
  10746.         printer ports.
  10747.  
  10748.  
  10749.         Syntax:
  10750.          NetAddCon (net-path, password, local-name)
  10751.  
  10752.         Parameters:
  10753.          (s) net-path     net resource or string returned by NetBrowse.
  10754.          (s) password     password required to access resource, or "".
  10755.          (s) local-name   local drive name or printer port.
  10756.  
  10757.         Returns:
  10758.          (i)          @TRUE if successful; @FALSE if unsuccessful.
  10759.  
  10760.         You can use NetAddCon to connect a local drive to a network
  10761.         directory, in which case "local-name" will be a drive name (eg,
  10762.         "Z:").  You can also connect a local printer port to a network
  10763.         print queue, in which case "local-name" will be the name of the
  10764.         printer port (eg, "LPT1").
  10765.  
  10766.         Use the NetBrowse function to obtain a value for "net-path".
  10767.  
  10768.         If no password is required, use a null string ("") for the
  10769.         "password" parameter.
  10770.  
  10771.  
  10772.         Example:
  10773.          availdrive = DiskScan(0)
  10774.          drvlen = StrLen(availdrive)
  10775.          If drvlen == 0 Then Goto nomore
  10776.          availdrive = StrSub(availdrive, drvlen - 2, 2)
  10777.          netpath = NetBrowse(0)
  10778.          pwd = AskPassword("Enter password for", netpath)
  10779.          NetAddCon(netpath, pwd, availdrive)
  10780.          Exit
  10781.          :nomore
  10782.          Message("Connect Drive to Net", "No drives avail for assignment")
  10783.  
  10784.  
  10785.         See Also:
  10786.            NetAttach, NetBrowse, NetCancelCon, NetGetCon, NetMapRoot
  10787.  
  10788.  
  10789.  
  10790.  
  10791.  
  10792.  
  10793.          ________________________________________________________________
  10794.                                                                       181
  10795.  
  10796.                                                                 NetAttach
  10797.          ________________________________________________________________
  10798.  
  10799.  
  10800.  
  10801.  
  10802.         NetAttach
  10803.         Attaches to a network file server.
  10804.  
  10805.  
  10806.         Syntax:
  10807.          NetAttach (server-name)
  10808.  
  10809.         Parameters:
  10810.          (s) server-name    name of the network file server.
  10811.  
  10812.         Returns:
  10813.          (i)                @TRUE if successful; @FALSE if unsuccessful.
  10814.  
  10815.         This function may not work with all networks.
  10816.  
  10817.  
  10818.         Example:
  10819.          NetAttach("userapps")
  10820.  
  10821.  
  10822.         See Also:
  10823.            NetAddCon, NetDetach, NetLogin
  10824.  
  10825.  
  10826.  
  10827.  
  10828.  
  10829.  
  10830.  
  10831.  
  10832.  
  10833.  
  10834.  
  10835.  
  10836.  
  10837.  
  10838.  
  10839.  
  10840.  
  10841.  
  10842.  
  10843.  
  10844.  
  10845.  
  10846.  
  10847.  
  10848.  
  10849.  
  10850.  
  10851.          ________________________________________________________________
  10852.                                                                       182
  10853.  
  10854.                                                                 NetBrowse
  10855.          ________________________________________________________________
  10856.  
  10857.  
  10858.  
  10859.  
  10860.         NetBrowse
  10861.         Displays a network dialog box allowing the user to select a network
  10862.         resource.
  10863.  
  10864.  
  10865.         Syntax:
  10866.          NetBrowse   (request#)
  10867.  
  10868.         Parameters:
  10869.          (i) request#   see below.
  10870.  
  10871.         Returns:
  10872.          (s)            see below.
  10873.  
  10874.         Specifying a request# of 0 allows selection of a network directory,
  10875.         and specifying a request# of 1 allows selection of a network print
  10876.         queue.  This function returns a string that can be used by
  10877.         NetAddCon to add a connection.
  10878.  
  10879.  
  10880.         Example:
  10881.          availdrive = DiskScan(0)
  10882.          drvlen = StrLen(availdrive)
  10883.          If drvlen == 0 Then Goto nomore
  10884.          availdrive = StrSub(availdrive, drvlen - 2, 2)
  10885.          netpath = NetBrowse(0)
  10886.          pswd = AskPassword("Enter password for", netpath)
  10887.          NetAddCon(netpath, pswd, availdrive)
  10888.          Exit
  10889.          :nomore
  10890.          Message("Connect Drive to Net", "No drives avail for assignment")
  10891.  
  10892.  
  10893.         See Also:
  10894.            NetAddCon, NetMapRoot
  10895.  
  10896.  
  10897.  
  10898.  
  10899.  
  10900.  
  10901.  
  10902.  
  10903.  
  10904.  
  10905.  
  10906.  
  10907.  
  10908.  
  10909.          ________________________________________________________________
  10910.                                                                       183
  10911.  
  10912.                                                              NetCancelCon
  10913.          ________________________________________________________________
  10914.  
  10915.  
  10916.  
  10917.  
  10918.         NetCancelCon
  10919.         Breaks a network connection.
  10920.  
  10921.  
  10922.         Syntax:
  10923.          NetCancelCon (name, force)
  10924.  
  10925.         Parameters:
  10926.          (s) name     network resource name or local name.
  10927.          (i) force    force flag (see below).
  10928.  
  10929.         Returns:
  10930.          (i)          @TRUE if successful; @FALSE if unsuccessful.
  10931.  
  10932.         If force is set to 0, NetCancelCon will not break the connection if
  10933.         any files on that connection are still open.  If force is set to 1,
  10934.         the connection will be broken regardless.
  10935.  
  10936.  
  10937.         Example:
  10938.          availdrive = DiskScan(4)
  10939.          n = ItemCount(availdrive, " ")
  10940.          If n == 0 Then Exit
  10941.          i = 1
  10942.          dislist = ""
  10943.          :loop
  10944.          drv = ItemExtract(i, availdrive, " ")
  10945.          dislist = StrCat(drv, Num2Char(9), NetGetCon(drv), "|")
  10946.          i = i + 1
  10947.          If i < n Then Goto loop
  10948.          availdrive = ItemSelect("Disconnect", dislist, "|")
  10949.          NetCancelCon(availdrive, 0)
  10950.  
  10951.  
  10952.         See Also:
  10953.            NetAddCon, NetDetach, NetGetCon
  10954.  
  10955.  
  10956.  
  10957.  
  10958.  
  10959.  
  10960.  
  10961.  
  10962.  
  10963.  
  10964.  
  10965.  
  10966.  
  10967.          ________________________________________________________________
  10968.                                                                       184
  10969.  
  10970.                                                                 NetDetach
  10971.          ________________________________________________________________
  10972.  
  10973.  
  10974.  
  10975.  
  10976.         NetDetach
  10977.         Detaches from a network file server.
  10978.  
  10979.  
  10980.         Syntax:
  10981.          NetDetach (server-name)
  10982.  
  10983.         Parameters:
  10984.          (s) server-name    name of the network file server.
  10985.  
  10986.         Returns:
  10987.          (i)                @TRUE if successful; @FALSE if unsuccessful.
  10988.  
  10989.         This function may not work with all networks.
  10990.  
  10991.  
  10992.         Example:
  10993.          NetDetach("userapps")
  10994.  
  10995.  
  10996.         See Also:
  10997.            NetAttach, NetCancelCon
  10998.  
  10999.  
  11000.  
  11001.  
  11002.  
  11003.  
  11004.  
  11005.  
  11006.  
  11007.  
  11008.  
  11009.  
  11010.  
  11011.  
  11012.  
  11013.  
  11014.  
  11015.  
  11016.  
  11017.  
  11018.  
  11019.  
  11020.  
  11021.  
  11022.  
  11023.  
  11024.  
  11025.          ________________________________________________________________
  11026.                                                                       185
  11027.  
  11028.                                                                 NetDialog
  11029.          ________________________________________________________________
  11030.  
  11031.  
  11032.  
  11033.  
  11034.         NetDialog
  11035.         Brings up the network driver's dialog box.
  11036.  
  11037.  
  11038.         Syntax:
  11039.          NetDialog ( )
  11040.  
  11041.         Parameters:
  11042.          (none)
  11043.  
  11044.         Returns:
  11045.          (i)          @TRUE if successful; @FALSE if unsuccessful.
  11046.  
  11047.         A network driver's dialog box displays copyright information, and
  11048.         may allow access to the network, depending on the particular
  11049.         network driver.  The WIL program will wait until the network dialog
  11050.         terminates before continuing.
  11051.  
  11052.  
  11053.         Example:
  11054.          NetDialog()
  11055.  
  11056.  
  11057.  
  11058.  
  11059.  
  11060.  
  11061.  
  11062.  
  11063.  
  11064.  
  11065.  
  11066.  
  11067.  
  11068.  
  11069.  
  11070.  
  11071.  
  11072.  
  11073.  
  11074.  
  11075.  
  11076.  
  11077.  
  11078.  
  11079.  
  11080.  
  11081.  
  11082.  
  11083.          ________________________________________________________________
  11084.                                                                       186
  11085.  
  11086.                                                                NetGetCaps
  11087.          ________________________________________________________________
  11088.  
  11089.  
  11090.  
  11091.  
  11092.         NetGetCaps
  11093.         Returns information on network capabilities.
  11094.  
  11095.  
  11096.         Syntax:
  11097.          NetGetCaps (request#)
  11098.  
  11099.         Parameters:
  11100.          (i) request#   see below.
  11101.  
  11102.         Returns:
  11103.          (i)            see below.
  11104.  
  11105.         NetGetCaps returns 0 if no network is installed (it is the only
  11106.         network function you can use without having a network installed and
  11107.         not get an error).
  11108.  
  11109.            Req# Return value
  11110.  
  11111.            1    Network driver specification number
  11112.  
  11113.            2    Type of network installed:
  11114.                 0        None
  11115.                 256      MS Network
  11116.                 512      Lan Manager
  11117.                 768      Novell NetWare
  11118.                 1024     Banyan Vines
  11119.                 1280     10 Net
  11120.                 (other)  Other network
  11121.  
  11122.            3    Network driver version number
  11123.  
  11124.            4    Returns 1 if any network is installed
  11125.  
  11126.            6    Bitmask indicating whether the network driver supports the
  11127.                 following connect functions:
  11128.                 1    AddConnection
  11129.                 2    CancelConnection
  11130.                 4    GetConnection
  11131.                 8    AutoConnect via DOS
  11132.                 16   BrowseDialog
  11133.  
  11134.            7    Bitmask indicating whether the network driver supports the
  11135.                 following print functions:
  11136.                 2    Open Print Job
  11137.                 4    Close Print Job
  11138.  
  11139.          ________________________________________________________________
  11140.                                                                       187
  11141.  
  11142.                                                                NetGetCaps
  11143.          ________________________________________________________________
  11144.  
  11145.                 16   Hold Print Job
  11146.                 32   Release Print Job
  11147.                 64   Cancel Print Job
  11148.                 128  Set number of copies
  11149.                 256  Watch Print Queue
  11150.                 512  Unwatch Print Queue
  11151.                 1024 Lock Queue Data
  11152.                 2048 Unlock Queue Data
  11153.                 4096 Driver will send QueueChanged messages to
  11154.                      Print Manager
  11155.                 8192 Abort Print Job
  11156.  
  11157.  
  11158.         Example:
  11159.          caps = NetGetCaps(6)
  11160.          If caps & 16 Then Message("", "Your network supports
  11161.          BrowseDialog")
  11162.  
  11163.         See Also:
  11164.            NetGetUser, WinConfig, WinMetrics, WinParmGet
  11165.  
  11166.  
  11167.  
  11168.  
  11169.  
  11170.  
  11171.  
  11172.  
  11173.  
  11174.  
  11175.  
  11176.  
  11177.  
  11178.  
  11179.  
  11180.  
  11181.  
  11182.  
  11183.  
  11184.  
  11185.  
  11186.  
  11187.  
  11188.  
  11189.  
  11190.  
  11191.  
  11192.  
  11193.  
  11194.  
  11195.  
  11196.  
  11197.          ________________________________________________________________
  11198.                                                                       188
  11199.  
  11200.                                                                 NetGetCon
  11201.          ________________________________________________________________
  11202.  
  11203.  
  11204.  
  11205.  
  11206.         NetGetCon
  11207.         Returns the name of a connected network resource.
  11208.  
  11209.  
  11210.         Syntax:
  11211.          NetGetCon (local-name)
  11212.  
  11213.         Parameters:
  11214.          (s) local-name     local drive name or printer port.
  11215.  
  11216.         Returns:
  11217.          (s)                name of network resource.
  11218.  
  11219.         NetGetCon returns the name of the network resource currently
  11220.         connected to "local-name".
  11221.  
  11222.  
  11223.         Example:
  11224.          local = AskLine("NetGetCon", "Enter local drive name", "")
  11225.          If local == "" Then Exit
  11226.          resource = NetGetCon(local)
  11227.          Message("NetGetCon", "%local% is connected to %resource%")
  11228.  
  11229.  
  11230.         See Also:
  11231.            NetAddCon, NetCancelCon
  11232.  
  11233.  
  11234.  
  11235.  
  11236.  
  11237.  
  11238.  
  11239.  
  11240.  
  11241.  
  11242.  
  11243.  
  11244.  
  11245.  
  11246.  
  11247.  
  11248.  
  11249.  
  11250.  
  11251.  
  11252.  
  11253.  
  11254.  
  11255.          ________________________________________________________________
  11256.                                                                       189
  11257.  
  11258.                                                                NetGetUser
  11259.          ________________________________________________________________
  11260.  
  11261.  
  11262.  
  11263.  
  11264.         NetGetUser
  11265.         Returns the name of the user currently logged into the network.
  11266.  
  11267.  
  11268.         Syntax:
  11269.          NetGetUser ( )
  11270.  
  11271.         Parameters:
  11272.          (none)
  11273.  
  11274.         Returns:
  11275.          (s)          name of current user.
  11276.  
  11277.  
  11278.         Example:
  11279.          IniWritePvt("Current Users", "Excel", NetGetUser(),
  11280.          "usagelog.ini")
  11281.          Run("excel.exe", "")
  11282.  
  11283.  
  11284.         See Also:
  11285.            NetGetCaps
  11286.  
  11287.  
  11288.  
  11289.  
  11290.  
  11291.  
  11292.  
  11293.  
  11294.  
  11295.  
  11296.  
  11297.  
  11298.  
  11299.  
  11300.  
  11301.  
  11302.  
  11303.  
  11304.  
  11305.  
  11306.  
  11307.  
  11308.  
  11309.  
  11310.  
  11311.  
  11312.  
  11313.          ________________________________________________________________
  11314.                                                                       190
  11315.  
  11316.                                                                  NetLogin
  11317.          ________________________________________________________________
  11318.  
  11319.  
  11320.  
  11321.  
  11322.         NetLogin
  11323.         Performs a network login.
  11324.  
  11325.  
  11326.         Syntax:
  11327.          NetLogin (server-name, user-name, password)
  11328.  
  11329.         Parameters:
  11330.          (s) server-name    name of the network file server.
  11331.          (s) user-name      name of the current user.
  11332.          (s) password       password required to access server, or "".
  11333.  
  11334.         Returns:
  11335.          (i)          @TRUE if successful; @FALSE if unsuccessful.
  11336.  
  11337.         This function may not work with all networks.
  11338.  
  11339.  
  11340.         Example:
  11341.          pwd = AskPassword("Hello", "Enter password for network access")
  11342.          NetLogin("userapps", "admin1", pwd)
  11343.  
  11344.  
  11345.         See Also:
  11346.            NetAttach, NetLogout
  11347.  
  11348.  
  11349.  
  11350.  
  11351.  
  11352.  
  11353.  
  11354.  
  11355.  
  11356.  
  11357.  
  11358.  
  11359.  
  11360.  
  11361.  
  11362.  
  11363.  
  11364.  
  11365.  
  11366.  
  11367.  
  11368.  
  11369.  
  11370.  
  11371.          ________________________________________________________________
  11372.                                                                       191
  11373.  
  11374.                                                                 NetLogout
  11375.          ________________________________________________________________
  11376.  
  11377.  
  11378.  
  11379.  
  11380.         NetLogout
  11381.         Performs a network logout.
  11382.  
  11383.  
  11384.         Syntax:
  11385.          NetLogout (server-name)
  11386.  
  11387.         Parameters:
  11388.          (s) server-name    name of the network file server.
  11389.  
  11390.         Returns:
  11391.          (i)                @TRUE if successful; @FALSE if unsuccessful.
  11392.  
  11393.         This function may not work with all networks.
  11394.  
  11395.  
  11396.         Example:
  11397.          NetLogout("userapps")
  11398.  
  11399.  
  11400.         See Also:
  11401.            NetLogin
  11402.  
  11403.  
  11404.  
  11405.  
  11406.  
  11407.  
  11408.  
  11409.  
  11410.  
  11411.  
  11412.  
  11413.  
  11414.  
  11415.  
  11416.  
  11417.  
  11418.  
  11419.  
  11420.  
  11421.  
  11422.  
  11423.  
  11424.  
  11425.  
  11426.  
  11427.  
  11428.  
  11429.          ________________________________________________________________
  11430.                                                                       192
  11431.  
  11432.                                                                NetMapRoot
  11433.          ________________________________________________________________
  11434.  
  11435.  
  11436.  
  11437.  
  11438.         NetMapRoot
  11439.         Maps a local drive to a network resource.
  11440.  
  11441.  
  11442.         Syntax:
  11443.          NetMapRoot (local-name, net-path)
  11444.  
  11445.         Parameters:
  11446.          (s) local-name     local drive name.
  11447.          (s) net-path       net resource or string returned by NetBrowse.
  11448.  
  11449.         Returns:
  11450.          (i)                @TRUE if successful; @FALSE if unsuccessful.
  11451.  
  11452.         This function maps a local drive letter as the fake root to a
  11453.         network resource.  This is supported by Novell NetWare, but may not
  11454.         work with any other networks.
  11455.  
  11456.  
  11457.         Example:
  11458.          availdrive = DiskScan(0)
  11459.          drvlen = StrLen(availdrive)
  11460.          If drvlen == 0 Then Goto nomore
  11461.          availdrive = StrSub(availdrive, drvlen - 2, 2)
  11462.          netpath = NetBrowse(0)
  11463.          NetMapRoot(availdrive, netpath)
  11464.          Exit
  11465.          :nomore
  11466.          Message("Connect Drive to Net", "No drives avail for assignment")
  11467.  
  11468.  
  11469.         See Also:
  11470.            NetAddCon, NetBrowse, NetCancelCon
  11471.  
  11472.  
  11473.  
  11474.  
  11475.  
  11476.  
  11477.  
  11478.  
  11479.  
  11480.  
  11481.  
  11482.  
  11483.  
  11484.  
  11485.  
  11486.  
  11487.          ________________________________________________________________
  11488.                                                                       193
  11489.  
  11490.                                                              NetMemberGet
  11491.          ________________________________________________________________
  11492.  
  11493.  
  11494.  
  11495.  
  11496.         NetMemberGet
  11497.         Determines whether the current user is a member of a specific
  11498.         group.
  11499.  
  11500.  
  11501.         Syntax:
  11502.          NetMemberGet (server-name, group-name)
  11503.  
  11504.         Parameters:
  11505.          (s) server-name    name of the network file server.
  11506.          (s) group-name     name of the group.
  11507.  
  11508.         Returns:
  11509.          (i)                @TRUE if successful; @FALSE if unsuccessful.
  11510.  
  11511.         This function may not work with all networks.
  11512.  
  11513.  
  11514.         Example:
  11515.          member = NetMemberGet("userapps", "sales")
  11516.          If member == @YES Then Run("notepad.exe", "dailyrpt.txt")
  11517.  
  11518.  
  11519.         See Also:
  11520.            NetMemberSet
  11521.  
  11522.  
  11523.  
  11524.  
  11525.  
  11526.  
  11527.  
  11528.  
  11529.  
  11530.  
  11531.  
  11532.  
  11533.  
  11534.  
  11535.  
  11536.  
  11537.  
  11538.  
  11539.  
  11540.  
  11541.  
  11542.  
  11543.  
  11544.  
  11545.          ________________________________________________________________
  11546.                                                                       194
  11547.  
  11548.                                                              NetMemberSet
  11549.          ________________________________________________________________
  11550.  
  11551.  
  11552.  
  11553.  
  11554.         NetMemberSet
  11555.         Sets the current user as a member of a group.
  11556.  
  11557.  
  11558.         Syntax:
  11559.          NetMemberSet (server-name, group-name)
  11560.  
  11561.         Parameters:
  11562.          (s) server-name    name of the network file server.
  11563.          (s) group-name     name of the group.
  11564.  
  11565.         Returns:
  11566.          (i)                @TRUE if successful; @FALSE if unsuccessful.
  11567.  
  11568.         This function may not work with all networks.
  11569.  
  11570.  
  11571.         Example:
  11572.          NetMemberSet("userapps", "sales")
  11573.  
  11574.  
  11575.         See Also:
  11576.            NetMemberGet
  11577.  
  11578.  
  11579.  
  11580.  
  11581.  
  11582.  
  11583.  
  11584.  
  11585.  
  11586.  
  11587.  
  11588.  
  11589.  
  11590.  
  11591.  
  11592.  
  11593.  
  11594.  
  11595.  
  11596.  
  11597.  
  11598.  
  11599.  
  11600.  
  11601.  
  11602.  
  11603.          ________________________________________________________________
  11604.                                                                       195
  11605.  
  11606.                                                                 NetMsgAll
  11607.          ________________________________________________________________
  11608.  
  11609.  
  11610.  
  11611.  
  11612.         NetMsgAll
  11613.         Broadcasts a message to all users on the network.
  11614.  
  11615.  
  11616.         Syntax:
  11617.          NetMsgAll (server-name, message)
  11618.  
  11619.         Parameters:
  11620.          (s) server-name    name of the network file server.
  11621.          (s) message        message to be broadcast.
  11622.  
  11623.         Returns:
  11624.          (i)                @TRUE if successful; @FALSE if unsuccessful.
  11625.  
  11626.         This function may not work with all networks.
  11627.  
  11628.  
  11629.         Example:
  11630.          NetMsgAll("userapps", "System going down in 5 minutes.")
  11631.  
  11632.  
  11633.         See Also:
  11634.            NetMsgSend
  11635.  
  11636.  
  11637.  
  11638.  
  11639.  
  11640.  
  11641.  
  11642.  
  11643.  
  11644.  
  11645.  
  11646.  
  11647.  
  11648.  
  11649.  
  11650.  
  11651.  
  11652.  
  11653.  
  11654.  
  11655.  
  11656.  
  11657.  
  11658.  
  11659.  
  11660.  
  11661.          ________________________________________________________________
  11662.                                                                       196
  11663.  
  11664.                                                                NetMsgSend
  11665.          ________________________________________________________________
  11666.  
  11667.  
  11668.  
  11669.  
  11670.         NetMsgSend
  11671.         Sends a message to a specific user on the network.
  11672.  
  11673.  
  11674.         Syntax:
  11675.          NetMsgSend (server-name, user-name, message)
  11676.  
  11677.         Parameters:
  11678.          (s) server-name    name of the network file server.
  11679.          (s) user-name      name of the user to whom the message should
  11680.                             be sent.
  11681.          (s) message        message to be sent.
  11682.  
  11683.         Returns:
  11684.          (i)                @TRUE if successful; @FALSE if unsuccessful.
  11685.  
  11686.         This function may not work with all networks.
  11687.  
  11688.  
  11689.         Example:
  11690.          NetMsgSend("userapps", "compmgr", "Are those reports ready yet?")
  11691.  
  11692.  
  11693.         See Also:
  11694.            NetMsgAll
  11695.  
  11696.  
  11697.  
  11698.  
  11699.  
  11700.  
  11701.  
  11702.  
  11703.  
  11704.  
  11705.  
  11706.  
  11707.  
  11708.  
  11709.  
  11710.  
  11711.  
  11712.  
  11713.  
  11714.  
  11715.  
  11716.  
  11717.  
  11718.  
  11719.          ________________________________________________________________
  11720.                                                                       197
  11721.  
  11722.                                                                  Num2Char
  11723.          ________________________________________________________________
  11724.  
  11725.  
  11726.  
  11727.  
  11728.         Num2Char
  11729.         Converts a number to its character equivalent.
  11730.  
  11731.  
  11732.         Syntax:
  11733.          Num2Char (integer)
  11734.  
  11735.         Parameters:
  11736.          (i) number   any number from 0 to 255.
  11737.  
  11738.         Returns:
  11739.          (s)          one-byte string containing the character which the
  11740.                       number represents.
  11741.  
  11742.         Use this function to convert a number to its ASCII equivalent.
  11743.  
  11744.  
  11745.         Example:
  11746.          ; Build a variable containing a CRLF combo
  11747.          crlf = StrCat(Num2Char(13), Num2Char(10))
  11748.          Message("NUM2CHAR", StrCat("line1", crlf, "line2"))
  11749.  
  11750.  
  11751.         See Also:
  11752.            Char2Num, IsNumber
  11753.  
  11754.  
  11755.  
  11756.  
  11757.  
  11758.  
  11759.  
  11760.  
  11761.  
  11762.  
  11763.  
  11764.  
  11765.  
  11766.  
  11767.  
  11768.  
  11769.  
  11770.  
  11771.  
  11772.  
  11773.  
  11774.  
  11775.  
  11776.  
  11777.          ________________________________________________________________
  11778.                                                                       198
  11779.  
  11780.                                                                 ParseData
  11781.          ________________________________________________________________
  11782.  
  11783.  
  11784.  
  11785.  
  11786.         ParseData
  11787.         Parses the passed string.
  11788.  
  11789.  
  11790.         Syntax:
  11791.          ParseData (string)
  11792.  
  11793.         Parameters:
  11794.          (s) string   string to be parsed.
  11795.  
  11796.         Returns:
  11797.          (i)          number of parameters in string.
  11798.  
  11799.         This function breaks a string constant or string variable into new
  11800.         sub-string variables named param1, param2, etc. (maximum of nine
  11801.         parameters).  Blank spaces in the original string are used as
  11802.         delimiters to create the new variables.
  11803.  
  11804.         Param0 is the count of how many sub-strings are found in "string".
  11805.  
  11806.  
  11807.         Example:
  11808.          username = AskLine("Hello", "Please enter your name","")
  11809.          ParseData(username)
  11810.  
  11811.         If the user enters:
  11812.  
  11813.            Joe Q. User
  11814.  
  11815.         ParseData would create the following variables:
  11816.  
  11817.            param1 ==   Joe
  11818.            param2 ==   Q.
  11819.            param3 ==   User
  11820.            param0 ==   3
  11821.  
  11822.  
  11823.         See Also:
  11824.            ItemExtract, StrSub
  11825.  
  11826.  
  11827.  
  11828.  
  11829.  
  11830.  
  11831.  
  11832.  
  11833.  
  11834.  
  11835.          ________________________________________________________________
  11836.                                                                       199
  11837.  
  11838.                                                                     Pause
  11839.          ________________________________________________________________
  11840.  
  11841.  
  11842.  
  11843.  
  11844.         Pause
  11845.         Provides a message to user.  User may cancel processing.
  11846.  
  11847.  
  11848.         Syntax:
  11849.          Pause (title, text)
  11850.  
  11851.         Parameters:
  11852.          (s) title    title of pause box.
  11853.          (s) text     text of the message to be displayed.
  11854.  
  11855.         Returns:
  11856.          (i)          always 1.
  11857.  
  11858.         This function displays a message to the user with an exclamation
  11859.         point icon.  The user may respond by selecting the OK button, or
  11860.         may cancel the processing by selecting Cancel.
  11861.  
  11862.         The Pause function is similar to the Message function, except for
  11863.         the addition of the Cancel button and icon.
  11864.  
  11865.  
  11866.         Example:
  11867.          Pause("Change Disks", "Insert new disk into Drive A:")
  11868.  
  11869.         which produces:
  11870.  
  11871.               ....................................
  11872.               .           Change Disks           .
  11873.               ....................................
  11874.               .                                  .
  11875.               .   Insert new disk into Drive A:  .
  11876.               .                                  .
  11877.               .      [Ok]           [Cancel]     .
  11878.               ....................................
  11879.  
  11880.  
  11881.         See Also:
  11882.            Display, Exit, Message, Terminate
  11883.  
  11884.  
  11885.  
  11886.  
  11887.  
  11888.  
  11889.  
  11890.  
  11891.  
  11892.  
  11893.          ________________________________________________________________
  11894.                                                                       200
  11895.  
  11896.                                                                 PlayMedia
  11897.          ________________________________________________________________
  11898.  
  11899.  
  11900.  
  11901.  
  11902.         PlayMedia
  11903.         Controls multimedia devices.
  11904.  
  11905.  
  11906.         Syntax:
  11907.          PlayMedia (command-string)
  11908.  
  11909.         Parameters:
  11910.          (s) command-string     string to be sent to the multimedia device.
  11911.  
  11912.         Returns:
  11913.          (s)                    response from the device.
  11914.  
  11915.         If the appropriate Windows multimedia extensions are present, this
  11916.         function can control multimedia devices.  Valid command strings
  11917.         depend on the multimedia devices and drivers installed.  The basic
  11918.         Windows multimedia package has a waveform device to play and record
  11919.         waveforms, and a sequencer device to play MID files.  Refer to the
  11920.         appropriate documentation for information on command strings.
  11921.  
  11922.         Many multimedia devices accept the WAIT or NOTIFY parameters as
  11923.         part of the command string:
  11924.  
  11925.            WAIT          Causes the system to stop processing input until
  11926.                          the requested operation is complete.  You cannot
  11927.                          switch tasks when WAIT is specified.
  11928.  
  11929.            NOTIFY        Causes the WIL program to suspend execution until
  11930.                          the requested operation completes.  You can
  11931.                          perform other tasks and switch between tasks when
  11932.                          NOTIFY is specified.
  11933.  
  11934.            WAIT NOTIFY   Same as WAIT
  11935.  
  11936.         If neither WAIT nor NOTIFY is specified, the multimedia operation
  11937.         is started and control returns immediately to the WIL program.
  11938.  
  11939.         In general, if you simply want the WIL program to wait until the
  11940.         multimedia operation is complete, use the NOTIFY keyword.  If you
  11941.         want the system to hang until the operation is complete, use WAIT.
  11942.         If you just want to start a multimedia operation and have the
  11943.         program continue processing, don't use either keyword.
  11944.  
  11945.         The return value from PlayMedia is whatever string the driver
  11946.         returns.  This will depend on the particular driver, as well as on
  11947.         the type of operation performed.
  11948.  
  11949.  
  11950.  
  11951.          ________________________________________________________________
  11952.                                                                       201
  11953.  
  11954.                                                                 PlayMedia
  11955.          ________________________________________________________________
  11956.  
  11957.  
  11958.         Example:
  11959.          ; Plays a music CD on a CDAudio player.  It plays whatever is in
  11960.          ; the drive, from start to finish
  11961.          stat = PlayMedia("status cdaudio mode")
  11962.          answer = 1
  11963.          If stat == "playing" Then answer = AskYesNo("CD Audio", "CD is
  11964.                Playing.  Stop?")
  11965.          If answer == 0 Then Exit
  11966.          PlayMedia("open cdaudio shareable alias donna notify")
  11967.          PlayMedia("set donna time format tmsf")
  11968.          PlayMedia("play donna from 1")
  11969.          PlayMedia("close donna")
  11970.          Exit
  11971.          :cancel
  11972.          PlayMedia("set cdaudio door open")
  11973.  
  11974.  
  11975.         See Also:
  11976.            Beep, PlayMidi, PlayWaveForm, Sounds
  11977.  
  11978.  
  11979.  
  11980.  
  11981.  
  11982.  
  11983.  
  11984.  
  11985.  
  11986.  
  11987.  
  11988.  
  11989.  
  11990.  
  11991.  
  11992.  
  11993.  
  11994.  
  11995.  
  11996.  
  11997.  
  11998.  
  11999.  
  12000.  
  12001.  
  12002.  
  12003.  
  12004.  
  12005.  
  12006.  
  12007.  
  12008.  
  12009.          ________________________________________________________________
  12010.                                                                       202
  12011.  
  12012.                                                                  PlayMidi
  12013.          ________________________________________________________________
  12014.  
  12015.  
  12016.  
  12017.  
  12018.         PlayMidi
  12019.         Plays a MID or RMI sound file.
  12020.  
  12021.  
  12022.         Syntax:
  12023.          PlayMidi (filename, mode)
  12024.  
  12025.         Parameters:
  12026.          (s) filename    name of the MID or RMI sound file.
  12027.          (i) mode        play mode (see below).
  12028.  
  12029.         Returns:
  12030.          (i)             @TRUE if successful; @FALSE if unsuccessful.
  12031.  
  12032.         If Windows multimedia sound extensions are present, and MIDI-
  12033.         compatible hardware is installed, this function will play a MID or
  12034.         RMI sound file.  If "filename" is not in the current directory and
  12035.         a directory is not specified, the path will be searched to find the
  12036.         file.
  12037.  
  12038.         If "mode" is set to 0, the WIL program will wait for the sound file
  12039.         to complete before continuing.  If "mode" is set to 1, it will
  12040.         start playing the sound file and continue immediately.
  12041.  
  12042.  
  12043.         Example:
  12044.          PlayMidi("canyon.mid", 1)
  12045.  
  12046.  
  12047.         See Also:
  12048.            Beep, PlayMedia, PlayWaveForm, Sounds
  12049.  
  12050.  
  12051.  
  12052.  
  12053.  
  12054.  
  12055.  
  12056.  
  12057.  
  12058.  
  12059.  
  12060.  
  12061.  
  12062.  
  12063.  
  12064.  
  12065.  
  12066.  
  12067.          ________________________________________________________________
  12068.                                                                       203
  12069.  
  12070.                                                              PlayWaveForm
  12071.          ________________________________________________________________
  12072.  
  12073.  
  12074.  
  12075.  
  12076.         PlayWaveForm
  12077.         Plays a WAV sound file.
  12078.  
  12079.  
  12080.         Syntax:
  12081.          PlayWaveForm (filename, mode)
  12082.  
  12083.         Parameters:
  12084.          (s) filename   name of *.WAV waveform file
  12085.          (i) mode       play mode (see below).
  12086.  
  12087.         Returns:
  12088.          (i)            @TRUE if successful; @FALSE if unsuccessful.
  12089.  
  12090.         If Windows multimedia sound extensions are present, and waveform-
  12091.         compatible hardware is installed, this function will play a WAV
  12092.         sound file.  If "filename" is not in the current directory and a
  12093.         directory is not specified, the path will be searched to find the
  12094.         file.  If "filename is not found, the WAV file associated with the
  12095.         "SystemDefault" keyword is played, (unless the "NoDefault" setting
  12096.         is on).
  12097.  
  12098.         Instead of specifying an actual filename, you may specify a keyword
  12099.         name from the [Sound] section of the WIN.INI file (eg,
  12100.         "SystemStart"), in which case the WAV file associated with that
  12101.         keyword name will be played.
  12102.  
  12103.         "Mode" is a bitmask, composed of the following bits:
  12104.  
  12105.            Mode Meaning
  12106.  
  12107.            0    Wait for the sound to end before continuing.
  12108.            1    Don't wait for the sound to end.  Start the sound and
  12109.                 immediately process more statements.
  12110.            2    If sound file not found, do not play a default sound
  12111.            9    Continue playing the sound forever, or until a
  12112.                 PlayWaveForm("", 0) statement is executed
  12113.            16   If another sound is already playing, do not interrupt it.
  12114.                 Just ignore this PlayWaveForm request.
  12115.  
  12116.         You can combine these bits using the binary OR operator.
  12117.  
  12118.         The command PlayWaveForm("", 0) can be used at any time to stop
  12119.         sound.
  12120.  
  12121.  
  12122.  
  12123.  
  12124.  
  12125.          ________________________________________________________________
  12126.                                                                       204
  12127.  
  12128.                                                              PlayWaveForm
  12129.          ________________________________________________________________
  12130.  
  12131.  
  12132.         Examples:
  12133.          PlayWaveForm("tada.wav", 0)
  12134.  
  12135.          PlayWaveForm("SystemDefault", 1 | 16)
  12136.  
  12137.  
  12138.         See Also:
  12139.            Beep, PlayMedia, PlayMidi, Sounds
  12140.  
  12141.  
  12142.  
  12143.  
  12144.  
  12145.  
  12146.  
  12147.  
  12148.  
  12149.  
  12150.  
  12151.  
  12152.  
  12153.  
  12154.  
  12155.  
  12156.  
  12157.  
  12158.  
  12159.  
  12160.  
  12161.  
  12162.  
  12163.  
  12164.  
  12165.  
  12166.  
  12167.  
  12168.  
  12169.  
  12170.  
  12171.  
  12172.  
  12173.  
  12174.  
  12175.  
  12176.  
  12177.  
  12178.  
  12179.  
  12180.  
  12181.  
  12182.  
  12183.          ________________________________________________________________
  12184.                                                                       205
  12185.  
  12186.                                                                    Random
  12187.          ________________________________________________________________
  12188.  
  12189.  
  12190.  
  12191.  
  12192.         Random
  12193.         Computes a pseudo-random number.
  12194.  
  12195.  
  12196.         Syntax:
  12197.          Random (max)
  12198.  
  12199.         Parameters:
  12200.          (i) max      largest desired integer number.
  12201.  
  12202.         Returns:
  12203.          (i)          unpredictable positive number.
  12204.  
  12205.         This function will return a random integer between 0 and max.
  12206.  
  12207.  
  12208.         Example:
  12209.          a = Random(79)
  12210.          Message("Random number between 0 and 79", a)
  12211.  
  12212.  
  12213.         See Also:
  12214.            Average, Max, Min
  12215.  
  12216.  
  12217.  
  12218.  
  12219.  
  12220.  
  12221.  
  12222.  
  12223.  
  12224.  
  12225.  
  12226.  
  12227.  
  12228.  
  12229.  
  12230.  
  12231.  
  12232.  
  12233.  
  12234.  
  12235.  
  12236.  
  12237.  
  12238.  
  12239.  
  12240.  
  12241.          ________________________________________________________________
  12242.                                                                       206
  12243.  
  12244.                                                               Reload {*M}
  12245.          ________________________________________________________________
  12246.  
  12247.  
  12248.  
  12249.  
  12250.         Reload {*M}
  12251.         Reloads menu file(s).
  12252.  
  12253.  
  12254.         Syntax:
  12255.          Reload ( )
  12256.  
  12257.         Parameters:
  12258.          (none)
  12259.  
  12260.         Returns:
  12261.          (i)          always 1.
  12262.  
  12263.         This function is used to reload the WIL Interpreter's menu file(s).
  12264.         It is useful after editing a menu file, to cause the changes to
  12265.         immediately take effect.
  12266.  
  12267.         Note:  This command does not take effect until the WIL program has
  12268.         completed, regardless of where the command may appear in the
  12269.         program.
  12270.  
  12271.  
  12272.         Example:
  12273.          RunZoomWait("notepad.exe", "c:\win\cmdpost.cpm")
  12274.          Reload()
  12275.  
  12276.  
  12277.  
  12278.  
  12279.  
  12280.  
  12281.  
  12282.  
  12283.  
  12284.  
  12285.  
  12286.  
  12287.  
  12288.  
  12289.  
  12290.  
  12291.  
  12292.  
  12293.  
  12294.  
  12295.  
  12296.  
  12297.  
  12298.  
  12299.          ________________________________________________________________
  12300.                                                                       207
  12301.  
  12302.                                                                    Return
  12303.          ________________________________________________________________
  12304.  
  12305.  
  12306.  
  12307.  
  12308.         Return
  12309.         Used to return from a Call to the calling program.
  12310.  
  12311.  
  12312.         Syntax:
  12313.          Return
  12314.  
  12315.         Parameters:
  12316.          (none)
  12317.  
  12318.         Returns:
  12319.          (not applicable)
  12320.  
  12321.  
  12322.         If the current program was not called by another program, an Exit
  12323.         is assumed.
  12324.  
  12325.  
  12326.         Example:
  12327.          Display(2, "End of subroutine", "Returning to MAIN.WBT")
  12328.          Return
  12329.  
  12330.  
  12331.         See Also:
  12332.            Call, Exit
  12333.  
  12334.  
  12335.  
  12336.  
  12337.  
  12338.  
  12339.  
  12340.  
  12341.  
  12342.  
  12343.  
  12344.  
  12345.  
  12346.  
  12347.  
  12348.  
  12349.  
  12350.  
  12351.  
  12352.  
  12353.  
  12354.  
  12355.  
  12356.  
  12357.          ________________________________________________________________
  12358.                                                                       208
  12359.  
  12360.                                                                       Run
  12361.          ________________________________________________________________
  12362.  
  12363.  
  12364.  
  12365.  
  12366.         Run
  12367.         Runs a program as a normal window.
  12368.  
  12369.  
  12370.         Syntax:
  12371.          Run (program-name, parameters)
  12372.  
  12373.         Parameters:
  12374.          (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  12375.                             file, or a data file.
  12376.          (s) parameters     optional parameters as required by the
  12377.                             application.
  12378.  
  12379.         Returns:
  12380.          (i)                @TRUE if the program was found;
  12381.                             @FALSE if it wasn't.
  12382.  
  12383.         Use this command to run an application.
  12384.  
  12385.         If the drive and path are not part of the program name, the current
  12386.         directory will be examined first, followed by the Windows and
  12387.         Windows System directories, and then the DOS path will be searched
  12388.         to find the desired executable file.
  12389.  
  12390.         If the "program-name" doesn't have an extension of .EXE, .COM,
  12391.         .PIF, or .BAT, it will be run in accordance with whatever is in the
  12392.         [extensions] section of the WIN.INI file.  When this happens, any
  12393.         "parameters" you specified are ignored.
  12394.  
  12395.  
  12396.         Examples:
  12397.          Run("notepad.exe", "abc.txt")
  12398.  
  12399.          Run("clock.exe", "")
  12400.  
  12401.          Run("paint.exe", "pict.msp")
  12402.  
  12403.  
  12404.         See Also:
  12405.            AppExist, RunHide, RunIcon, RunWait, RunZoom, WinClose,
  12406.            WinExeName, WinWaitClose
  12407.  
  12408.  
  12409.  
  12410.  
  12411.  
  12412.  
  12413.  
  12414.  
  12415.          ________________________________________________________________
  12416.                                                                       209
  12417.  
  12418.                                                                   RunHide
  12419.          ________________________________________________________________
  12420.  
  12421.  
  12422.  
  12423.  
  12424.         RunHide
  12425.         Runs a program as a hidden window.
  12426.  
  12427.  
  12428.         Syntax:
  12429.          RunHide (program-name, parameters)
  12430.  
  12431.         Parameters:
  12432.          (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  12433.                             file, or a data file.
  12434.          (s) parameters     optional parameters as required by the
  12435.                             application.
  12436.  
  12437.         Returns:
  12438.          (i)                @TRUE if the program was found;
  12439.                             @FALSE if it wasn't.
  12440.  
  12441.         Use this command to run an application as a hidden window.
  12442.  
  12443.         If the drive and path are not part of the program name, the current
  12444.         directory will be examined first, followed by the Windows and
  12445.         Windows System directories, and then the DOS path will be searched
  12446.         to find the desired executable file.
  12447.  
  12448.         If the "program-name" doesn't have an extension of .EXE, .COM,
  12449.         .PIF, or .BAT, it will be run in accordance with whatever is in the
  12450.         [extensions] section of the WIN.INI file.  When this happens, any
  12451.         "parameters" you specified are ignored.
  12452.  
  12453.         Note:  When this command launches an application, it informs it
  12454.         that you want it to run as a hidden window.  Whether or not the
  12455.         application honors your wish is beyond RunHide's control.
  12456.  
  12457.  
  12458.         Examples:
  12459.          RunHide("notepad.exe", "abc.txt")
  12460.  
  12461.          RunHide("clock.exe", "")
  12462.  
  12463.          RunHide("paint.exe", "pict.msp")
  12464.  
  12465.  
  12466.         See Also:
  12467.            Run, RunHideWait, RunIcon, RunZoom, WinClose, WinExeName,
  12468.            WinHide, WinWaitClose
  12469.  
  12470.  
  12471.  
  12472.  
  12473.          ________________________________________________________________
  12474.                                                                       210
  12475.  
  12476.                                                               RunHideWait
  12477.          ________________________________________________________________
  12478.  
  12479.  
  12480.  
  12481.  
  12482.         RunHideWait
  12483.         Runs a program as a hidden window, and waits for it to close.
  12484.  
  12485.  
  12486.         Syntax:
  12487.          RunHideWait (program-name, parameters)
  12488.  
  12489.         Parameters:
  12490.          (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  12491.                             file, or a data file.
  12492.          (s) parameters     optional parameters as required by the
  12493.                             application.
  12494.  
  12495.         Returns:
  12496.          (i)                @TRUE if the program was found;
  12497.                             @FALSE if it wasn't.
  12498.  
  12499.         Use this command to run an application as a hidden window.  The WIL
  12500.         program will suspend processing until the application is closed.
  12501.  
  12502.         If the drive and path are not part of the program name, the current
  12503.         directory will be examined first, followed by the Windows and
  12504.         Windows System directories, and then the DOS path will be searched
  12505.         to find the desired executable file.
  12506.  
  12507.         If the "program-name" doesn't have an extension of .EXE, .COM,
  12508.         .PIF, or .BAT, it will be run in accordance with whatever is in the
  12509.         [extensions] section of the WIN.INI file.  When this happens, any
  12510.         "parameters" you specified are ignored.
  12511.  
  12512.         Note:  When this command launches an application, it informs it
  12513.         that you want it to run as a hidden window.  Whether or not the
  12514.         application honors your wish is beyond RunHideWait's control.
  12515.  
  12516.  
  12517.         Example:
  12518.          NetAddCon("winword", "", "g:")
  12519.          RunHideWait("winword.exe", "")
  12520.          NetCancelCon("g:", 0)
  12521.  
  12522.  
  12523.         See Also:
  12524.            RunHide, RunIconWait, RunWait, RunZoomWait, WinWaitClose
  12525.  
  12526.  
  12527.  
  12528.  
  12529.  
  12530.  
  12531.          ________________________________________________________________
  12532.                                                                       211
  12533.  
  12534.                                                                   RunIcon
  12535.          ________________________________________________________________
  12536.  
  12537.  
  12538.  
  12539.  
  12540.         RunIcon
  12541.         Runs a program as an iconic (minimized) window.
  12542.  
  12543.  
  12544.         Syntax:
  12545.          RunIcon (program-name, parameters)
  12546.  
  12547.         Parameters:
  12548.          (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  12549.                             file, or a data file.
  12550.          (s) parameters     optional parameters as required by the
  12551.                             application.
  12552.  
  12553.         Returns:
  12554.          (i)                @TRUE if the program was found;
  12555.                             @FALSE if it wasn't.
  12556.  
  12557.         Use this command to run an application as an icon.
  12558.  
  12559.         If the drive and path are not part of the program name, the current
  12560.         directory will be examined first, followed by the Windows and
  12561.         Windows System directories, and then the DOS path will be searched
  12562.         to find the desired executable file.
  12563.  
  12564.         If the "program-name" doesn't have an extension of .EXE, .COM,
  12565.         .PIF, or .BAT, it will be run in accordance with whatever is in the
  12566.         [extensions] section of the WIN.INI file.  When this happens, any
  12567.         "parameters" you specified are ignored.
  12568.  
  12569.         Note:  When this command launches an application, it merely informs
  12570.         it that you want it to begin as an icon.  Whether or not the
  12571.         application honors your wish is beyond RunIcon's control.
  12572.  
  12573.  
  12574.         Examples:
  12575.          RunIcon("notepad.exe", "abc.txt")
  12576.  
  12577.          RunIcon("clock.exe", "")
  12578.  
  12579.          RunIcon("paint.exe", "pict.msp")
  12580.  
  12581.  
  12582.         See Also:
  12583.            IconArrange, Run, RunHide, RunIconWait, RunZoom, WinClose,
  12584.            WinExeName, WinIconize, WinWaitClose
  12585.  
  12586.  
  12587.  
  12588.  
  12589.          ________________________________________________________________
  12590.                                                                       212
  12591.  
  12592.                                                               RunIconWait
  12593.          ________________________________________________________________
  12594.  
  12595.  
  12596.  
  12597.  
  12598.         RunIconWait
  12599.         Runs a program as an iconic (minimized) window, and waits for it to
  12600.         close.
  12601.  
  12602.  
  12603.         Syntax:
  12604.          RunIconWait (program-name, parameters)
  12605.  
  12606.         Parameters:
  12607.          (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  12608.                             file, or a data file.
  12609.          (s) parameters     optional parameters as required by the
  12610.                             application.
  12611.  
  12612.         Returns:
  12613.          (i)                @TRUE if the program was found;
  12614.                             @FALSE if it wasn't.
  12615.  
  12616.         Use this command to run an application as an icon.  The WIL program
  12617.         will suspend processing until the application is closed.
  12618.  
  12619.         If the drive and path are not part of the program name, the current
  12620.         directory will be examined first, followed by the Windows and
  12621.         Windows System directories, and then the DOS path will be searched
  12622.         to find the desired executable file.
  12623.  
  12624.         If the "program-name" doesn't have an extension of .EXE, .COM,
  12625.         .PIF, or .BAT, it will be run in accordance with whatever is in the
  12626.         [extensions] section of the WIN.INI file.  When this happens, any
  12627.         "parameters" you specified are ignored.
  12628.  
  12629.         Note:  When this command launches an application, it merely informs
  12630.         it that you want it to begin as an icon.  Whether or not the
  12631.         application honors your wish is beyond RunIconWait's control.
  12632.  
  12633.  
  12634.         Example:
  12635.          NetAddCon("winword", "", "g:")
  12636.          RunIconWait("winword.exe", "")
  12637.          NetCancelCon("g:", 0)
  12638.  
  12639.  
  12640.         See Also:
  12641.            IconArrange, RunHideWait, RunIcon, RunWait, RunZoomWait,
  12642.            WinWaitClose
  12643.  
  12644.  
  12645.  
  12646.  
  12647.          ________________________________________________________________
  12648.                                                                       213
  12649.  
  12650.                                                                   RunWait
  12651.          ________________________________________________________________
  12652.  
  12653.  
  12654.  
  12655.  
  12656.         RunWait
  12657.         Runs a program as a normal window, and waits for it to close.
  12658.  
  12659.  
  12660.         Syntax:
  12661.          RunWait (program-name, parameters)
  12662.  
  12663.         Parameters:
  12664.          (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  12665.                             file, or a data file.
  12666.          (s) parameters     optional parameters as required by the
  12667.                             application.
  12668.  
  12669.         Returns:
  12670.          (i)                @TRUE if the program was found;
  12671.                             @FALSE if it wasn't.
  12672.  
  12673.         Use this command to run an application.  The WIL program will
  12674.         suspend processing until the application is closed.
  12675.  
  12676.         If the drive and path are not part of the program name, the current
  12677.         directory will be examined first, followed by the Windows and
  12678.         Windows System directories, and then the DOS path will be searched
  12679.         to find the desired executable file.
  12680.  
  12681.         If the "program-name" doesn't have an extension of .EXE, .COM,
  12682.         .PIF, or .BAT, it will be run in accordance with whatever is in the
  12683.         [extensions] section of the WIN.INI file.  When this happens, any
  12684.         "parameters" you specified are ignored.
  12685.  
  12686.  
  12687.         Example:
  12688.          NetAddCon("winword", "", "g:")
  12689.          RunWait("winword.exe", "")
  12690.          NetCancelCon("g:", 0)
  12691.  
  12692.  
  12693.         See Also:
  12694.            AppWaitClose, Run, RunHideWait, RunIconWait, RunZoomWait,
  12695.            WinWaitClose
  12696.  
  12697.  
  12698.  
  12699.  
  12700.  
  12701.  
  12702.  
  12703.  
  12704.  
  12705.          ________________________________________________________________
  12706.                                                                       214
  12707.  
  12708.                                                                   RunZoom
  12709.          ________________________________________________________________
  12710.  
  12711.  
  12712.  
  12713.  
  12714.         RunZoom
  12715.         Runs a program as a full-screen (maximized) window.
  12716.  
  12717.  
  12718.         Syntax:
  12719.          RunZoom (program-name, parameters)
  12720.  
  12721.         Parameters:
  12722.          (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  12723.                             file, or a data file.
  12724.          (s) parameters     optional parameters as required by the
  12725.                             application.
  12726.  
  12727.         Returns:
  12728.          (i)                @TRUE if the program was found;
  12729.                             @FALSE if it wasn't.
  12730.  
  12731.         Use this command to run an application as a full-screen window.
  12732.  
  12733.         If the drive and path are not part of the program name, the current
  12734.         directory will be examined first, followed by the Windows and
  12735.         Windows System directories, and then the DOS path will be searched
  12736.         to find the desired executable file.
  12737.  
  12738.         If the "program-name" doesn't have an extension of .EXE, .COM,
  12739.         .PIF, or .BAT, it will be run in accordance with whatever is in the
  12740.         [Extensions] section of the WIN.INI file.  When this happens, any
  12741.         "parameters" you specified are ignored.
  12742.  
  12743.         Note:  When this command launches an application, it merely informs
  12744.         it that you want it to be maximized to full-screen.  Whether or not
  12745.         the application honors your wish is beyond RunZoom's control.
  12746.  
  12747.  
  12748.         Examples:
  12749.          RunZoom("notepad.exe", "abc.txt")
  12750.  
  12751.          RunZoom("clock.exe", "")
  12752.  
  12753.          RunZoom("paint.exe", "pict.msp")
  12754.  
  12755.  
  12756.         See Also:
  12757.            Run, RunHide, RunIcon, RunZoomWait, WinClose, WinExeName,
  12758.            WinWaitClose, WinZoom
  12759.  
  12760.  
  12761.  
  12762.  
  12763.          ________________________________________________________________
  12764.                                                                       215
  12765.  
  12766.                                                               RunZoomWait
  12767.          ________________________________________________________________
  12768.  
  12769.  
  12770.  
  12771.  
  12772.         RunZoomWait
  12773.         Runs a program as a full-screen (maximized) window, and waits for
  12774.         it to close.
  12775.  
  12776.  
  12777.         Syntax:
  12778.          RunZoomWait (program-name, parameters)
  12779.  
  12780.         Parameters:
  12781.          (s) program-name   the name of the desired .EXE, .COM, .PIF, .BAT
  12782.                             file, or a data file.
  12783.          (s) parameters     optional parameters as required by the
  12784.                             application.
  12785.  
  12786.         Returns:
  12787.          (i)                @TRUE if the program was found;
  12788.                             @FALSE if it wasn't.
  12789.  
  12790.         Use this command to run an application as a full-screen window.
  12791.         The WIL program will suspend processing until the application is
  12792.         closed.
  12793.  
  12794.         If the drive and path are not part of the program name, the current
  12795.         directory will be examined first, followed by the Windows and
  12796.         Windows System directories, and then the DOS path will be searched
  12797.         to find the desired executable file.
  12798.  
  12799.         If the "program-name" doesn't have an extension of .EXE, .COM,
  12800.         .PIF, or .BAT, it will be run in accordance with whatever is in the
  12801.         [Extensions] section of the WIN.INI file.  When this happens, any
  12802.         "parameters" you specified are ignored.
  12803.  
  12804.         Note:  When this command launches an application, it merely informs
  12805.         it that you want it to be maximized to full-screen.  Whether or not
  12806.         the application honors your wish is beyond RunZoomWait's control.
  12807.  
  12808.  
  12809.         Example:
  12810.          NetAddCon("winword", "", "g:")
  12811.          RunZoomWait("winword.exe", "")
  12812.          NetCancelCon("g:", 0)
  12813.  
  12814.  
  12815.         See Also:
  12816.            RunHideWait, RunIconWait, RunWait, RunZoom, WinWaitClose
  12817.  
  12818.  
  12819.  
  12820.  
  12821.          ________________________________________________________________
  12822.                                                                       216
  12823.  
  12824.                                                                   SendKey
  12825.          ________________________________________________________________
  12826.  
  12827.  
  12828.  
  12829.  
  12830.         SendKey
  12831.         Sends keystrokes to the active application.
  12832.  
  12833.  
  12834.         Syntax:
  12835.          SendKey (char-string)
  12836.  
  12837.         Parameters:
  12838.          (s) char-string    string of regular and/or special characters.
  12839.  
  12840.         Returns:
  12841.          (i)          always 0.
  12842.  
  12843.         This function is used to send keystrokes to the current window,
  12844.         just as if they had been entered from the keyboard.  Any
  12845.         alphanumeric character, and most punctuation marks and other
  12846.         symbols which appear on the keyboard, may be sent simply by placing
  12847.         it in the "char-string."  In addition, the following special
  12848.         characters, enclosed in "curly" braces, may be placed in "char-
  12849.         string" to send the corresponding special characters:
  12850.  
  12851.            Key         SendKey equivalent
  12852.  
  12853.            ~           {~}
  12854.            !           {!}
  12855.            ^           {^}
  12856.            +           {+}
  12857.  
  12858.            Alt         {ALT}
  12859.            Backspace   {BACKSPACE} or {BS}
  12860.            Caps Lock   {CAPSLOCK}
  12861.            Clear       {CLEAR}
  12862.            Delete      {DELETE} or {DEL}
  12863.            Down Arrow  {DOWN}
  12864.            End         {END}
  12865.            Enter       {ENTER} or ~
  12866.            Escape      {ESCAPE} or {ESC}
  12867.            F1 thru F16 {F1} through {F16}
  12868.            Help        {HELP}
  12869.            Home        {HOME}
  12870.            Insert      {INSERT} or {INS}
  12871.            Left Arrow  {LEFT}
  12872.            Num Lock    {NUMLOCK}
  12873.            Page Down   {PGDN}
  12874.            Page Up     {PGUP}
  12875.            Print Scrn  {PRTSC}    *** See Snapshot function ***
  12876.            Right Arrow {RIGHT}
  12877.            Space       {SPACE} or {SP}
  12878.  
  12879.          ________________________________________________________________
  12880.                                                                       217
  12881.  
  12882.                                                                   SendKey
  12883.          ________________________________________________________________
  12884.  
  12885.            Tab         {TAB}
  12886.            Up Arrow    {UP}
  12887.  
  12888.         To enter an Alt, Control, or Shift key combination, precede the
  12889.         desired character with one or more of the following symbols:
  12890.  
  12891.            Alt         !
  12892.            Control     ^
  12893.            Shift       +
  12894.  
  12895.         To enter Alt-S:
  12896.  
  12897.          SendKey("!s")
  12898.  
  12899.         Note: You should use lower-case letters to represent Alt-key
  12900.         combinations and other menu shortcut keys.
  12901.  
  12902.         To enter Ctrl-Shift-F7:
  12903.  
  12904.          SendKey("^+{F7}")
  12905.  
  12906.         You may also repeat a key by enclosing it in braces, followed by a
  12907.         space and the total number of repetitions desired.
  12908.  
  12909.         To type 20 asterisks:
  12910.  
  12911.          SendKey("{* 20}")
  12912.  
  12913.         To move the cursor down 8 lines:
  12914.  
  12915.          SendKey("{DOWN 8}")
  12916.  
  12917.         It is possible to use SendKey to send keystrokes to a DOS
  12918.         application, but only if you are running Windows in 386 Enhanced
  12919.         mode.  You would then transfer the keystrokes to the DOS
  12920.         application via the Clipboard.  It is only possible to send
  12921.         standard ASCII characters to DOS applications; you cannot send
  12922.         function key or Alt-key combinations.
  12923.  
  12924.  
  12925.         Examples:
  12926.          ; start Notepad, and use *.* for filenames
  12927.          Run("notepad.exe", "")
  12928.          SendKey("!fo*.*~")
  12929.  
  12930.  
  12931.  
  12932.  
  12933.  
  12934.  
  12935.  
  12936.  
  12937.          ________________________________________________________________
  12938.                                                                       218
  12939.  
  12940.                                                                   SendKey
  12941.          ________________________________________________________________
  12942.  
  12943.          ; run DOS batch file which starts our editor
  12944.          Run("edit.bat", "")
  12945.          ; wait 15 seconds for editor to load
  12946.          Delay(15)
  12947.          ; send string (with carriage return) to the clipboard
  12948.          crlf = StrCat(Num2Char(13), Num2Char(10))
  12949.          ClipPut("Hello%crlf%")
  12950.          ; paste contents of clipboard to DOS window
  12951.          SendKey("!{SP}ep")
  12952.  
  12953.  
  12954.         In those cases where you have an application which can accept text
  12955.         pasted in from the clipboard, it will often be more efficient to
  12956.         use the ClipGet function:
  12957.  
  12958.          Run("notepad.exe", "")
  12959.          crlf = StrCat(Num2Char(13), Num2Char(10))
  12960.          ; copy some text to the clipboard
  12961.          ClipPut("Dear Sirs:%crlf%%crlf%")
  12962.          ; paste the text into Notepad (using Shift-Ins)
  12963.          SendKey("+{INSERT}")
  12964.  
  12965.  
  12966.  
  12967.         Note:  If your SendKey statement doesn't seem to be working (eg.,
  12968.         all you get are beeping noises), you may need to place a
  12969.         WinActivate statement before the SendKey statement to insure that
  12970.         you are sending the keystrokes to the correct window.
  12971.  
  12972.  
  12973.         See Also:
  12974.            ClipGet, SKDebug, SnapShot, WinActivate
  12975.  
  12976.  
  12977.  
  12978.  
  12979.  
  12980.  
  12981.  
  12982.  
  12983.  
  12984.  
  12985.  
  12986.  
  12987.  
  12988.  
  12989.  
  12990.  
  12991.  
  12992.  
  12993.  
  12994.  
  12995.          ________________________________________________________________
  12996.                                                                       219
  12997.  
  12998.                                                                   SKDebug
  12999.          ________________________________________________________________
  13000.  
  13001.  
  13002.  
  13003.  
  13004.         SKDebug
  13005.         Controls how SendKey works
  13006.  
  13007.  
  13008.         Syntax:
  13009.          SKDebug (mode)
  13010.  
  13011.         Parameters:
  13012.          (i) mode     @OFF        Keystrokes sent to application.  No debug
  13013.                                   file  written.  Default mode.
  13014.                       @ON         Keystrokes sent to application.  Debug
  13015.                                   file written.
  13016.                       @PARSEONLY  Keystrokes not sent to application.
  13017.                                   Debug file written.
  13018.  
  13019.         Returns:
  13020.          (i)          previous SKDebug mode.
  13021.  
  13022.         This function allows you to direct the keystrokes generated by your
  13023.         SendKey statements to a disk file in addition to, or instead of,
  13024.         the application window.  Normally, keystrokes are sent only to the
  13025.         application.  If you specify SKDebug (@ON), keystrokes are sent to
  13026.         a disk file as well as to the application.  If you specify SKDebug
  13027.         (@PARSEONLY), keystrokes are sent only to the disk file, and not to
  13028.         the application.  SKDebug (@OFF) returns to the default mode.
  13029.  
  13030.         By default, the file which will receive the parsed keystrokes is
  13031.         named C:\@@SKDBUG.TXT.  You can override this by making an entry in
  13032.         the [Main] section of the WWWBATCH.INI file, as follows:
  13033.  
  13034.            SKDFile=debug.fil
  13035.  
  13036.         where debug.fil is the filename, including complete path
  13037.         specification, that you want to receive the keystrokes.
  13038.  
  13039.  
  13040.         Example:
  13041.          Run("notepad.exe", "")
  13042.          SKDebug(@ON)
  13043.          SendKey("!fo*.*~")
  13044.          SKDebug(@OFF)
  13045.  
  13046.  
  13047.         See Also:
  13048.            Debug, SendKey
  13049.  
  13050.  
  13051.  
  13052.  
  13053.          ________________________________________________________________
  13054.                                                                       220
  13055.  
  13056.                                                                  SnapShot
  13057.          ________________________________________________________________
  13058.  
  13059.  
  13060.  
  13061.  
  13062.         SnapShot
  13063.         Takes a snapshot of the screen and pastes it to the clipboard.
  13064.  
  13065.  
  13066.         Syntax:
  13067.          SnapShot (request#)
  13068.  
  13069.         Parameters:
  13070.          (i) request# see below.
  13071.  
  13072.         Returns:
  13073.          (i)          always 0.
  13074.  
  13075.            Req# Meaning
  13076.  
  13077.            0    Take snapshot of entire screen
  13078.            1    Take snapshot of client area of parent window of active
  13079.                 window
  13080.            2    Take snapshot of entire area of parent window of active
  13081.                 window
  13082.            3    Take snapshot of client area of active window
  13083.            4    Take snapshot of entire area of active window
  13084.  
  13085.  
  13086.         Example:
  13087.          SnapShot(2)
  13088.  
  13089.  
  13090.         See Also:
  13091.            ClipPut
  13092.  
  13093.  
  13094.  
  13095.  
  13096.  
  13097.  
  13098.  
  13099.  
  13100.  
  13101.  
  13102.  
  13103.  
  13104.  
  13105.  
  13106.  
  13107.  
  13108.  
  13109.  
  13110.  
  13111.          ________________________________________________________________
  13112.                                                                       221
  13113.  
  13114.                                                                    Sounds
  13115.          ________________________________________________________________
  13116.  
  13117.  
  13118.  
  13119.  
  13120.         Sounds
  13121.         Turns sounds on or off.
  13122.  
  13123.  
  13124.         Syntax:
  13125.          Sounds (request#)
  13126.  
  13127.         Parameters:
  13128.          (i) request#    see below.
  13129.  
  13130.         Returns:
  13131.          (i)             previous Sound setting.
  13132.  
  13133.         If Windows multimedia sound extensions are present, this function
  13134.         turns sounds made by the WIL Interpreter on or off.  Specify a
  13135.         request# of 0 to turn sounds off, and a request# of 1 to turn them
  13136.         on.
  13137.  
  13138.         By default, the WIL Interpreter makes noise.  You can override this
  13139.         by entering:
  13140.  
  13141.            Sounds=0
  13142.  
  13143.         in the [Main] section of the WWWBATCH.INI file.
  13144.  
  13145.  
  13146.         Example:
  13147.          Sounds(0)
  13148.  
  13149.         See Also:
  13150.            Beep, PlayMedia, PlayMidi, PlayWaveForm
  13151.  
  13152.  
  13153.  
  13154.  
  13155.  
  13156.  
  13157.  
  13158.  
  13159.  
  13160.  
  13161.  
  13162.  
  13163.  
  13164.  
  13165.  
  13166.  
  13167.  
  13168.  
  13169.          ________________________________________________________________
  13170.                                                                       222
  13171.  
  13172.                                                                    StrCat
  13173.          ________________________________________________________________
  13174.  
  13175.  
  13176.  
  13177.  
  13178.         StrCat
  13179.         Concatenates two or more strings.
  13180.  
  13181.  
  13182.         Syntax:
  13183.          StrCat (string1, string2[, ..., stringN])
  13184.  
  13185.         Parameters:
  13186.          (s) string1, etc.    at least two strings you want to concatenate.
  13187.  
  13188.         Returns:
  13189.          (s)                  concatenation of the entire list of input
  13190.                               strings.
  13191.  
  13192.         Use this command to stick character strings together, or to format
  13193.         display messages.
  13194.  
  13195.  
  13196.         Example:
  13197.          user = AskLine("Login", "Your Name:", "")
  13198.          msg = StrCat("Hi, ", user)
  13199.          Message("Login", msg)
  13200.  
  13201.          ; note that this is the same as the second line above:
  13202.          msg = "Hi, %user%"
  13203.  
  13204.  
  13205.         See Also:
  13206.            StrFill, StrFix, StrTrim
  13207.  
  13208.  
  13209.  
  13210.  
  13211.  
  13212.  
  13213.  
  13214.  
  13215.  
  13216.  
  13217.  
  13218.  
  13219.  
  13220.  
  13221.  
  13222.  
  13223.  
  13224.  
  13225.  
  13226.  
  13227.          ________________________________________________________________
  13228.                                                                       223
  13229.  
  13230.                                                                    StrCmp
  13231.          ________________________________________________________________
  13232.  
  13233.  
  13234.  
  13235.  
  13236.         StrCmp
  13237.         Compares two strings.
  13238.  
  13239.  
  13240.         Syntax:
  13241.          StrCmp (string1, string2)
  13242.  
  13243.         Parameters:
  13244.          (s) string1, string2    strings to compare.
  13245.  
  13246.         Returns:
  13247.          (i)          -1, 0, or 1; depending on whether string1 is less
  13248.                       than, equal to, or greater than string2,
  13249.                       respectively.
  13250.  
  13251.         Use this command to determine whether two strings are equal, or
  13252.         which precedes the other in an ANSI sorting sequence.
  13253.  
  13254.         Note:  This command has been included for semantic completeness.
  13255.         The relational operators >, >=, ==, !=, <=, and < provide the same
  13256.         capability.
  13257.  
  13258.  
  13259.         Example:
  13260.          a = AskLine("STRCMP", "Enter a test line", "")
  13261.          b = AskLine("STRCMP", "Enter another test line", "")
  13262.          c = StrCmp(a, b)
  13263.          c = c + 1
  13264.          d = StrSub("less than   equal to    greater than", c * 12, 12)
  13265.          ; Note that above string is grouped into 12-character
  13266.          ; chunks.
  13267.          ; Desired chunk is removed with the StrSub statement.
  13268.          Message("STRCMP", "%a% is %d% %b%")
  13269.  
  13270.  
  13271.         See Also:
  13272.            StriCmp, StrIndex, StrLen, StrScan, StrSub
  13273.  
  13274.  
  13275.  
  13276.  
  13277.  
  13278.  
  13279.  
  13280.  
  13281.  
  13282.  
  13283.  
  13284.  
  13285.          ________________________________________________________________
  13286.                                                                       224
  13287.  
  13288.                                                                   StrFill
  13289.          ________________________________________________________________
  13290.  
  13291.  
  13292.  
  13293.  
  13294.         StrFill
  13295.         Creates a string filled with a series of characters.
  13296.  
  13297.  
  13298.         Syntax:
  13299.          StrFill (filler, length)
  13300.  
  13301.         Parameters:
  13302.          (s) filler    a string to be repeated to create the return string.
  13303.                        If the filler string is null, spaces will be used
  13304.                        instead.
  13305.          (i) length    the length of the desired string.
  13306.  
  13307.         Returns:
  13308.          (s)           character string.
  13309.  
  13310.         Use this function to create a string consisting of multiple copies
  13311.         of the filler string concatenated together.
  13312.  
  13313.  
  13314.         Example:
  13315.          Message("My Stars", StrFill("*", 30))
  13316.  
  13317.         which produces:
  13318.  
  13319.               ......................................
  13320.               .             My Stars               .
  13321.               ......................................
  13322.               .                                    .
  13323.               .   ******************************   .
  13324.               .                                    .
  13325.               .               [OK]                 .
  13326.               ......................................
  13327.  
  13328.  
  13329.         See Also:
  13330.            StrCat, StrFix, StrLen, StrTrim
  13331.  
  13332.  
  13333.  
  13334.  
  13335.  
  13336.  
  13337.  
  13338.  
  13339.  
  13340.  
  13341.  
  13342.  
  13343.          ________________________________________________________________
  13344.                                                                       225
  13345.  
  13346.                                                                    StrFix
  13347.          ________________________________________________________________
  13348.  
  13349.  
  13350.  
  13351.  
  13352.         StrFix
  13353.         Pads or truncates a string to a fixed length.
  13354.  
  13355.  
  13356.         Syntax:
  13357.          StrFix (base-string, pad-string, length)
  13358.  
  13359.         Parameters:
  13360.          (s) base-string    string to be adjusted to a fixed length.
  13361.          (s) pad-string     appended to base-string if needed to fill out
  13362.                             the desired length.  If pad-string is null,
  13363.                             spaces are used instead.
  13364.          (i) length         length of the desired string.
  13365.  
  13366.         Returns:
  13367.          (s)                fixed size string.
  13368.  
  13369.         This function "fixes" the length of a string, either by truncating
  13370.         it on the right, or by appending enough copies of pad-string to
  13371.         achieve the desired length.
  13372.  
  13373.  
  13374.         Example:
  13375.          a = StrFix("Henry", " ", 15)
  13376.          b = StrFix("Betty", " ", 15)
  13377.          c = StrFix("George", " ", 15)
  13378.          Message("Spaced Names", StrCat(a, b, c))
  13379.  
  13380.         which produces:
  13381.  
  13382.               ....................................................
  13383.               .                   Spaced names                   .
  13384.               ....................................................
  13385.               .                                                  .
  13386.               .   Henry          Betty          George           .
  13387.               .                                                  .
  13388.               .                     [OK]                         .
  13389.               ....................................................
  13390.  
  13391.  
  13392.         See Also:
  13393.            StrFill, StrLen, StrTrim
  13394.  
  13395.  
  13396.  
  13397.  
  13398.  
  13399.  
  13400.  
  13401.          ________________________________________________________________
  13402.                                                                       226
  13403.  
  13404.                                                                   StriCmp
  13405.          ________________________________________________________________
  13406.  
  13407.  
  13408.  
  13409.  
  13410.         StriCmp
  13411.         Compares two strings without regard to case.
  13412.  
  13413.  
  13414.         Syntax:
  13415.          StriCmp (string1, string2)
  13416.  
  13417.         Parameters:
  13418.          (s) string1, string2    strings to compare.
  13419.  
  13420.         Returns:
  13421.          (i)          -1, 0, or 1; depending on whether string1 is less
  13422.                       than, equal to, or greater than string2,
  13423.                       respectively.
  13424.  
  13425.         Use this command to determine whether two strings are equal, or
  13426.         which precedes the other in an ANSI sorting sequence, when case is
  13427.         ignored.
  13428.  
  13429.  
  13430.         Example:
  13431.          a = AskLine("STRICMP", "Enter a test line", "")
  13432.          b = AskLine("STRICMP", "Enter another test line", "")
  13433.          c = StriCmp(a, b)
  13434.          c = c + 1
  13435.          d = StrSub("less than   equal to    greater than", c * 12, 12)
  13436.          ; Note that above string is grouped into 12-character
  13437.          ; chunks.
  13438.          ; Desired chunk is removed with the StrSub statement.
  13439.          Message("STRICMP", "%a% is %d% %b%")
  13440.  
  13441.  
  13442.         See Also:
  13443.            StrCmp, StrIndex, StrLen, StrScan, StrSub
  13444.  
  13445.  
  13446.  
  13447.  
  13448.  
  13449.  
  13450.  
  13451.  
  13452.  
  13453.  
  13454.  
  13455.  
  13456.  
  13457.  
  13458.  
  13459.          ________________________________________________________________
  13460.                                                                       227
  13461.  
  13462.                                                                  StrIndex
  13463.          ________________________________________________________________
  13464.  
  13465.  
  13466.  
  13467.  
  13468.         StrIndex
  13469.         Searches a string for a substring.
  13470.  
  13471.  
  13472.         Syntax:
  13473.          StrIndex (string, substring, start, direction)
  13474.  
  13475.         Parameters:
  13476.          (s) string      the string to be searched for a substring.
  13477.          (s) substring   the string to look for within the main string.
  13478.          (i) start       the position in the main string to begin search.
  13479.                          The first character of a string is position 1.
  13480.          (i) direction   the search direction.  @FWDSCAN searches forward,
  13481.                          while @BACKSCAN searches backwards.
  13482.  
  13483.         Returns:
  13484.          (i)             position of substring within string, or 0 if not
  13485.                          found.
  13486.  
  13487.         This function searches for a substring within a "target" string.
  13488.         Starting at the "start" position, it goes forward or backward
  13489.         depending on the value of the "direction" parameter.  It stops when
  13490.         it finds the "substring" within the "target" string, and returns
  13491.         its position.
  13492.  
  13493.         A start position of 0 has special meaning depending on which
  13494.         direction you are scanning.  For forward searches, zero indicates
  13495.         the search should start at the beginning of the string.  For
  13496.         reverse searches, zero causes it to start at the end of the string.
  13497.  
  13498.  
  13499.         Example:
  13500.          instr = AskLine("STRINDEX", "Type a sentence:", "")
  13501.          start = 1
  13502.          end = StrIndex(instr, " ", start, @FWDSCAN)
  13503.          If end == 0 Then Goto error
  13504.          Message("STRINDEX", StrCat("The first word is: ", StrSub(instr,
  13505.              start, end - 1))
  13506.          Exit
  13507.          :error
  13508.          Message("Sorry...", "No spaces found")
  13509.  
  13510.  
  13511.         See Also:
  13512.            StrLen, StrScan, StrSub
  13513.  
  13514.  
  13515.  
  13516.  
  13517.          ________________________________________________________________
  13518.                                                                       228
  13519.  
  13520.                                                                    StrLen
  13521.          ________________________________________________________________
  13522.  
  13523.  
  13524.  
  13525.  
  13526.         StrLen
  13527.         Provides the length of a string.
  13528.  
  13529.  
  13530.         Syntax:
  13531.          StrLen (string)
  13532.  
  13533.         Parameters:
  13534.          (s) string   any text string.
  13535.  
  13536.         Returns:
  13537.          (i)          length of string.
  13538.  
  13539.         Use this command to determine the length of a string variable or
  13540.         expression.
  13541.  
  13542.  
  13543.         Example:
  13544.          myfile = AskLine("Filename", "File to process:", "")
  13545.          namlen = StrLen(myfile)
  13546.          If namlen > 13 Then Message("", "Filename too long!")
  13547.  
  13548.  
  13549.         See Also:
  13550.            StrFill, StrFix, StrIndex, StrScan, StrTrim
  13551.  
  13552.  
  13553.  
  13554.  
  13555.  
  13556.  
  13557.  
  13558.  
  13559.  
  13560.  
  13561.  
  13562.  
  13563.  
  13564.  
  13565.  
  13566.  
  13567.  
  13568.  
  13569.  
  13570.  
  13571.  
  13572.  
  13573.  
  13574.  
  13575.          ________________________________________________________________
  13576.                                                                       229
  13577.  
  13578.                                                                  StrLower
  13579.          ________________________________________________________________
  13580.  
  13581.  
  13582.  
  13583.  
  13584.         StrLower
  13585.         Converts a string to lowercase.
  13586.  
  13587.  
  13588.         Syntax:
  13589.          StrLower (string)
  13590.  
  13591.         Parameters:
  13592.          (s) string     any text string.
  13593.  
  13594.         Returns:
  13595.          (s)            lowercase string.
  13596.  
  13597.         Use this command to convert a text string to lower case.
  13598.  
  13599.  
  13600.         Example:
  13601.          a = AskLine("STRLOWER", "Enter text", "")
  13602.          b = StrLower(a)
  13603.          Message(a, b)
  13604.  
  13605.  
  13606.         See Also:
  13607.            StriCmp, StrUpper
  13608.  
  13609.  
  13610.  
  13611.  
  13612.  
  13613.  
  13614.  
  13615.  
  13616.  
  13617.  
  13618.  
  13619.  
  13620.  
  13621.  
  13622.  
  13623.  
  13624.  
  13625.  
  13626.  
  13627.  
  13628.  
  13629.  
  13630.  
  13631.  
  13632.  
  13633.          ________________________________________________________________
  13634.                                                                       230
  13635.  
  13636.                                                                StrReplace
  13637.          ________________________________________________________________
  13638.  
  13639.  
  13640.  
  13641.  
  13642.         StrReplace
  13643.         Replaces all occurances of a substring with another.
  13644.  
  13645.  
  13646.         Syntax:
  13647.          StrReplace (string, old, new)
  13648.  
  13649.         Parameters:
  13650.          (s) string   string in which to search.
  13651.          (s) old      target substring.
  13652.          (s) new      replacement substring.
  13653.  
  13654.         Returns:
  13655.          (s)          updated string, with old replaced by new.
  13656.  
  13657.  
  13658.         StrReplace scans the "string", searching for occurrences of "old"
  13659.         and replacing each occurrence with "new".
  13660.  
  13661.  
  13662.         Example:
  13663.          ; Copy all INI files to clipboard
  13664.          a = FileItemize("*.ini")
  13665.          crlf = StrCat(Num2Char(13), Num2Char(10))
  13666.          b = StrReplace(a, " ", crlf)
  13667.          ClipPut(b)
  13668.  
  13669.  
  13670.         See Also:
  13671.            StrIndex, StrScan, StrSub
  13672.  
  13673.  
  13674.  
  13675.  
  13676.  
  13677.  
  13678.  
  13679.  
  13680.  
  13681.  
  13682.  
  13683.  
  13684.  
  13685.  
  13686.  
  13687.  
  13688.  
  13689.  
  13690.  
  13691.          ________________________________________________________________
  13692.                                                                       231
  13693.  
  13694.                                                                   StrScan
  13695.          ________________________________________________________________
  13696.  
  13697.  
  13698.  
  13699.  
  13700.         StrScan
  13701.         Searches string for occurrence of delimiters.
  13702.  
  13703.  
  13704.         Syntax:
  13705.          StrScan (string, delimiters, start, direction)
  13706.  
  13707.         Parameters:
  13708.          (s) string         the string that is to be searched.
  13709.          (s) delimiters     a string of delimiters to search for within
  13710.                             string.
  13711.          (i) start          the position in the main string to begin
  13712.                             search.  The first character of a string is
  13713.                             position 1.
  13714.          (i) direction      the search direction.  @FWDSCAN searches
  13715.                             forward, while @BACKSCAN searches backwards.
  13716.  
  13717.         Returns:
  13718.          (i)                position of delimiter in string, or 0 if not
  13719.                             found.
  13720.  
  13721.         This function searches for delimiters within a target "string".
  13722.         Starting at the "start" position, it goes forward or backward
  13723.         depending on the value of the "direction" parameter.  It stops when
  13724.         it finds any one of the characters in the "delimiters" string
  13725.         within the target "string".
  13726.  
  13727.  
  13728.         Example:
  13729.          thestr = "123,456.789:abc"
  13730.          start = 1
  13731.          end = StrScan(thestr, ",.:", start, @FWDSCAN)
  13732.          If end == 0 Then Goto error
  13733.          Message("The first parameter", StrSub(thestr, start, end -
  13734.              start + 1))
  13735.          Exit
  13736.          :error
  13737.          Message("Sorry...", "No delimiters found")
  13738.  
  13739.  
  13740.         See Also:
  13741.            StrLen, StrSub
  13742.  
  13743.  
  13744.  
  13745.  
  13746.  
  13747.  
  13748.  
  13749.          ________________________________________________________________
  13750.                                                                       232
  13751.  
  13752.                                                                    StrSub
  13753.          ________________________________________________________________
  13754.  
  13755.  
  13756.  
  13757.  
  13758.         StrSub
  13759.         Extracts a substring out of an existing string.
  13760.  
  13761.  
  13762.         Syntax:
  13763.          StrSub (string, start, length)
  13764.  
  13765.         Parameters:
  13766.          (s) string   the string from which the substring is to be
  13767.                       extracted.
  13768.          (i) start    character position within string where the substring
  13769.                       starts.  (The first character of the string is at
  13770.                       position 1).
  13771.          (i) length   length of desired substring.  If you specify a length
  13772.                       of zero it will return a null string.
  13773.  
  13774.         Returns:
  13775.          (s)          substring of parameter string.
  13776.  
  13777.         This function extracts a substring from within a "target" string.
  13778.         Starting at the "start" position, it copies up to "length"
  13779.         characters into the substring.
  13780.  
  13781.  
  13782.         Example:
  13783.          a = "My dog has fleas"
  13784.          animal = StrSub(a, 4, 3)
  13785.          Message("STRSUB", "My animal is a %animal%")
  13786.  
  13787.  
  13788.         See Also:
  13789.            StrLen, StrScan
  13790.  
  13791.  
  13792.  
  13793.  
  13794.  
  13795.  
  13796.  
  13797.  
  13798.  
  13799.  
  13800.  
  13801.  
  13802.  
  13803.  
  13804.  
  13805.  
  13806.  
  13807.          ________________________________________________________________
  13808.                                                                       233
  13809.  
  13810.                                                                   StrTrim
  13811.          ________________________________________________________________
  13812.  
  13813.  
  13814.  
  13815.  
  13816.         StrTrim
  13817.         Removes leading and trailing blanks from a character string.
  13818.  
  13819.  
  13820.         Syntax:
  13821.          StrTrim (string)
  13822.  
  13823.         Parameters:
  13824.          (s) string   a string with unwanted spaces at the beginning and/or
  13825.                       end.
  13826.  
  13827.         Returns:
  13828.          (s)          string devoid of leading and trailing spaces.
  13829.  
  13830.         This function removes spaces and tab characters from the beginning
  13831.         and end of a text string.
  13832.  
  13833.  
  13834.         Example:
  13835.          myfile = AskLine("STRTRIM", "Filename ('exit' cancels)", "")
  13836.          tstexit = StrTrim(StrLower(myfile))
  13837.          If tstexit == "exit" Then Goto cancel
  13838.          ; processing of myfile continues...
  13839.          : cancel
  13840.          Message("Canceled", "...by user request")
  13841.  
  13842.  
  13843.         See Also:
  13844.            StrFill, StrFix, StrLen
  13845.  
  13846.  
  13847.  
  13848.  
  13849.  
  13850.  
  13851.  
  13852.  
  13853.  
  13854.  
  13855.  
  13856.  
  13857.  
  13858.  
  13859.  
  13860.  
  13861.  
  13862.  
  13863.  
  13864.  
  13865.          ________________________________________________________________
  13866.                                                                       234
  13867.  
  13868.                                                                  StrUpper
  13869.          ________________________________________________________________
  13870.  
  13871.  
  13872.  
  13873.  
  13874.         StrUpper
  13875.         Converts a string to uppercase.
  13876.  
  13877.  
  13878.         Syntax:
  13879.          StrUpper (string)
  13880.  
  13881.         Parameters:
  13882.          (s) string   any text string.
  13883.  
  13884.         Returns:
  13885.          (s)          uppercase string.
  13886.  
  13887.         Use this function to convert a text string to upper case.
  13888.  
  13889.  
  13890.         Example:
  13891.          a = AskLine("STRUPPER", "Enter text","")
  13892.          b = StrUpper(a)
  13893.          Message(a, b)
  13894.  
  13895.  
  13896.         See Also:
  13897.            StriCmp, StrLower
  13898.  
  13899.  
  13900.  
  13901.  
  13902.  
  13903.  
  13904.  
  13905.  
  13906.  
  13907.  
  13908.  
  13909.  
  13910.  
  13911.  
  13912.  
  13913.  
  13914.  
  13915.  
  13916.  
  13917.  
  13918.  
  13919.  
  13920.  
  13921.  
  13922.  
  13923.          ________________________________________________________________
  13924.                                                                       235
  13925.  
  13926.                                                                 Terminate
  13927.          ________________________________________________________________
  13928.  
  13929.  
  13930.  
  13931.  
  13932.         Terminate
  13933.         Conditionally ends a WIL program.
  13934.  
  13935.  
  13936.         Syntax:
  13937.          Terminate (expression, title, message)
  13938.  
  13939.         Parameters:
  13940.          (s) expression     any logical expression.
  13941.          (s) title          the title of a message box to be displayed
  13942.                             before termination.
  13943.          (s) message        the message in the message box.
  13944.  
  13945.         Returns:
  13946.          (i)                always 1.
  13947.  
  13948.         This command ends processing for the WIL program if "expression" is
  13949.         nonzero.  Note that many functions return @TRUE (1) or @FALSE (0),
  13950.         which you can use to decide whether to cancel a menu item.
  13951.  
  13952.         If either "title" or "message" contains a string, a message box
  13953.         with a title and a message is displayed before exiting.
  13954.  
  13955.  
  13956.         Examples:
  13957.          ; unconditional termination w/o message box (same as Exit)
  13958.          Terminate(@TRUE, "", "")
  13959.  
  13960.          ; basically a no-op:
  13961.          Terminate(@FALSE, "", "This will never terminate")
  13962.  
  13963.          ; exits with message if variable is less than zero:
  13964.          Terminate(a < 0, "Error", "Cannot use negative numbers")
  13965.  
  13966.          ; exits w/o message if answer isn't "YES":
  13967.          Terminate(answer != "YES", "", "")
  13968.  
  13969.  
  13970.         See Also:
  13971.            Display, Exit, Message, Pause
  13972.  
  13973.  
  13974.  
  13975.  
  13976.  
  13977.  
  13978.  
  13979.  
  13980.  
  13981.          ________________________________________________________________
  13982.                                                                       236
  13983.  
  13984.                                                                   TextBox
  13985.          ________________________________________________________________
  13986.  
  13987.  
  13988.  
  13989.  
  13990.         TextBox
  13991.         Displays a file in a listbox on the screen and returns the selected
  13992.         line.
  13993.  
  13994.  
  13995.         Syntax:
  13996.          TextBox (title, filename)
  13997.  
  13998.         Parameters:
  13999.          (s) title      listbox title.
  14000.          (s) filename   file containing contents of listbox.
  14001.  
  14002.         Returns:
  14003.          (s)            highlighted string, if any.
  14004.  
  14005.         This function loads a file into a Windows listbox and displays the
  14006.         listbox to the user.  TextBox has two primary uses:  First, it can
  14007.         be used to display multi-line messages to the user.  In addition,
  14008.         because of its ability to return a selected line, it may be used as
  14009.         a multiple choice question box.  The line highlighted by the user
  14010.         (if any) will be returned to the program.  If the user does not
  14011.         make a selection, a null string ("") is returned.
  14012.  
  14013.         If disk drive and path are not part of the filename, the current
  14014.         directory will be examined first, and then the DOS path will be
  14015.         searched to find the desired file.
  14016.  
  14017.         TextBox is like TextBoxSelect, except that with TextBoxSelect the
  14018.         items in the displayed box are sorted and with TextBox they are
  14019.         left unsorted.
  14020.  
  14021.  
  14022.         Example:
  14023.          ; Display WIN.INI
  14024.          a = TextBox("Choose a line", "c:\windows\win.ini")
  14025.          Display(3, "Chosen line", a)
  14026.  
  14027.         which produces (at least on my system):
  14028.  
  14029.  
  14030.  
  14031.  
  14032.  
  14033.  
  14034.  
  14035.  
  14036.  
  14037.  
  14038.  
  14039.          ________________________________________________________________
  14040.                                                                       237
  14041.  
  14042.                                                                   TextBox
  14043.          ________________________________________________________________
  14044.  
  14045.               ..........................................
  14046.               .            Choose a line               .
  14047.               ..........................................
  14048.               . _____________________________________  .
  14049.               . | [windows]                       |^|  .
  14050.               . | load=                           |x|  .
  14051.               . | run=                            |x|  .
  14052.               . | Beep=yes                        |x|  .
  14053.               . |<<Spooler=yes>>                  |x|  .
  14054.               . | BorderWidth=2                   |x|  .
  14055.               . | CursorBlinkRate=530             |x|  .
  14056.               . | DoubleClickSpeed=452            |x|  .
  14057.               . | swapdisk=                       |x|  .
  14058.               . | MousePresent=yes                |x|  .
  14059.               . |_________________________________|v|  .
  14060.               .                                        .
  14061.               .      [OK]                 [Cancel]     .
  14062.               ..........................................
  14063.  
  14064.         and then:
  14065.  
  14066.               ........................
  14067.               .      Chosen line     .
  14068.               ........................
  14069.               .                      .
  14070.               .      Spooler=yes     .
  14071.               .                      .
  14072.               .         [OK]         .
  14073.               ........................
  14074.  
  14075.  
  14076.         See Also:
  14077.            ItemSelect, TextBoxSort, TextSelect
  14078.  
  14079.  
  14080.  
  14081.  
  14082.  
  14083.  
  14084.  
  14085.  
  14086.  
  14087.  
  14088.  
  14089.  
  14090.  
  14091.  
  14092.  
  14093.  
  14094.  
  14095.  
  14096.  
  14097.          ________________________________________________________________
  14098.                                                                       238
  14099.  
  14100.                                                               TextBoxSort
  14101.          ________________________________________________________________
  14102.  
  14103.  
  14104.  
  14105.  
  14106.         TextBoxSort
  14107.         Displays a file in a sorted listbox on the screen and returns the
  14108.         selected line.
  14109.  
  14110.  
  14111.  
  14112.  
  14113.         Syntax:
  14114.          TextBoxSort (title, filename)
  14115.  
  14116.         Parameters:
  14117.          (s) title       listbox title.
  14118.          (s) filename    file containing contents of listbox.
  14119.  
  14120.         Returns:
  14121.          (s)             highlighted string, if any.
  14122.  
  14123.         This function loads a file into a Windows listbox, which is sorted
  14124.         alphabetically and displayed to the user.  The line highlighted by
  14125.         the user (if any) will be returned to the program.  If the user
  14126.         does not make a selection, a null string ("") is returned.
  14127.  
  14128.         If disk drive and path are not part of the filename, the current
  14129.         directory will be examined first, and then the DOS path will be
  14130.         searched to find the desired file.
  14131.  
  14132.         TextBox is like TextBoxSelect, except that with TextBoxSelect the
  14133.         items in the displayed box are sorted and with TextBox they are
  14134.         left unsorted.
  14135.  
  14136.  
  14137.         Example:
  14138.          a = TextBoxSort("Select a phone number", "phones.txt")
  14139.          Display(3, "Selected number is", a)
  14140.  
  14141.  
  14142.         See Also:
  14143.            ItemSelect, TextBox, TextSelect
  14144.  
  14145.  
  14146.  
  14147.  
  14148.  
  14149.  
  14150.  
  14151.  
  14152.  
  14153.  
  14154.  
  14155.          ________________________________________________________________
  14156.                                                                       239
  14157.  
  14158.                                                                TextSelect
  14159.          ________________________________________________________________
  14160.  
  14161.  
  14162.  
  14163.  
  14164.         TextSelect
  14165.         Allows the user to choose an item from an unsorted listbox.
  14166.  
  14167.  
  14168.         Syntax:
  14169.          TextSelect (title, list, delimiter)
  14170.  
  14171.         Parameters:
  14172.          (s) title      the title of dialog box to display.
  14173.          (s) list       a string containing a list of items to choose from.
  14174.          (s) delimiter  a string containing the character to act as
  14175.                         delimiter between items in the list.
  14176.  
  14177.         Returns:
  14178.          (s)            the selected item.
  14179.  
  14180.         This function displays a dialog box with a listbox inside.  This
  14181.         listbox is filled with an unsorted list of items taken from a
  14182.         string you provide to the function.
  14183.  
  14184.         Each item in the string must be separated (delimited) by a
  14185.         character, which you also pass to the function.
  14186.  
  14187.         The user selects one of the items by either doubleclicking on it,
  14188.         or single-clicking and pressing OK.  The item is returned as a
  14189.         string.
  14190.  
  14191.         If you create the list with the FileItemize or DirItemize functions
  14192.         you will be using a space-delimited list.  WinItemize, however,
  14193.         creates a tab-delimited list of window titles since titles can have
  14194.         embedded blanks.
  14195.  
  14196.         TextSelect is like ItemSelect, except that with TextSelect the
  14197.         displayed box is larger and the items in the box are not sorted
  14198.         alphabetically.
  14199.  
  14200.  
  14201.         Example:
  14202.          DirChange(DirWindows(0))
  14203.          inifiles = FileItemize("*.ini")
  14204.          ini = TextSelect("Select an INI file to edit", inifiles, " ")
  14205.          If ini == "" Then Exit
  14206.          RunZoom("notepad.exe", ini)
  14207.  
  14208.  
  14209.         See Also:
  14210.            AskLine, Dialog, DirItemize, FileItemize, ItemSelect, TextBox,
  14211.            TextBoxSort, WinItemize
  14212.  
  14213.          ________________________________________________________________
  14214.                                                                       240
  14215.  
  14216.                                                                      Then
  14217.          ________________________________________________________________
  14218.  
  14219.  
  14220.  
  14221.  
  14222.         Then
  14223.         Continues a previous If statement.
  14224.  
  14225.  
  14226.         Syntax:
  14227.          Then statement
  14228.  
  14229.         Parameters:
  14230.          (s) statement any valid WIL function or command.
  14231.  
  14232.         This command continues the last-encountered If command.  It
  14233.         provides a method of conditionally executing multiple statements,
  14234.         without having to test the condition more than once.  If the
  14235.         previous If condition was true, the statement following the Then
  14236.         keyword is executed.  If the previous If condition was false, the
  14237.         statement following the Then keyword is ignored.
  14238.  
  14239.  
  14240.         Example:
  14241.          answer = AskYesNo("Financial Management", "Run WinCheck now?")
  14242.          If answer == @YES Then DirChange("c:\win\check")
  14243.          Then Run("wincheck.exe", "")
  14244.          Then WinWaitClose("WinCheck")
  14245.          Message("Okay", "Processing complete")
  14246.  
  14247.  
  14248.         See Also:
  14249.            Else, Goto, If ... Then
  14250.  
  14251.  
  14252.  
  14253.  
  14254.  
  14255.  
  14256.  
  14257.  
  14258.  
  14259.  
  14260.  
  14261.  
  14262.  
  14263.  
  14264.  
  14265.  
  14266.  
  14267.  
  14268.  
  14269.  
  14270.  
  14271.          ________________________________________________________________
  14272.                                                                       241
  14273.  
  14274.                                                                   Version
  14275.          ________________________________________________________________
  14276.  
  14277.  
  14278.  
  14279.  
  14280.         Version
  14281.         Returns the version number of the parent program currently running.
  14282.  
  14283.  
  14284.         Syntax:
  14285.          Version ( )
  14286.  
  14287.         Parameters:
  14288.          (none)
  14289.  
  14290.         Returns:
  14291.          (s)          parent program version number.
  14292.  
  14293.         Use this function to determine the version of the parent program
  14294.         that is currently running.
  14295.  
  14296.  
  14297.         Example:
  14298.          ver = Version()
  14299.          Message("Version number", ver)
  14300.  
  14301.  
  14302.         See Also:
  14303.            DOSVersion, Environment, VersionDLL WinVersion
  14304.  
  14305.  
  14306.  
  14307.  
  14308.  
  14309.  
  14310.  
  14311.  
  14312.  
  14313.  
  14314.  
  14315.  
  14316.  
  14317.  
  14318.  
  14319.  
  14320.  
  14321.  
  14322.  
  14323.  
  14324.  
  14325.  
  14326.  
  14327.  
  14328.  
  14329.          ________________________________________________________________
  14330.                                                                       242
  14331.  
  14332.                                                                VersionDLL
  14333.          ________________________________________________________________
  14334.  
  14335.  
  14336.  
  14337.  
  14338.         VersionDLL
  14339.         Returns the version number of the WIL Interpreter currently
  14340.         running.
  14341.  
  14342.  
  14343.         Syntax:
  14344.          VersionDLL ( )
  14345.  
  14346.         Parameters:
  14347.          (none)
  14348.  
  14349.         Returns:
  14350.          (s)          WIL Interpreter version number.
  14351.  
  14352.         Use this function to determine the version of the WIL Interpreter
  14353.         that is currently running.  It is useful to verify that a WIL
  14354.         program generated with the latest version of the language will
  14355.         operate properly on what may be a different machine with a
  14356.         different version of the WIL Interpreter installed.
  14357.  
  14358.  
  14359.         Example:
  14360.          ver = VersionDLL()
  14361.          If ver >= "1.0c" Then Goto proceed
  14362.          Message("Sorry", "WIL Interpreter version 1.0c or higher
  14363.          required")
  14364.          Exit
  14365.          :proceed
  14366.          NetDialog()
  14367.  
  14368.  
  14369.         See Also:
  14370.            DOSVersion, Environment, Version, WinVersion
  14371.  
  14372.  
  14373.  
  14374.  
  14375.  
  14376.  
  14377.  
  14378.  
  14379.  
  14380.  
  14381.  
  14382.  
  14383.  
  14384.  
  14385.  
  14386.  
  14387.          ________________________________________________________________
  14388.                                                                       243
  14389.  
  14390.                                                                WaitForKey
  14391.          ________________________________________________________________
  14392.  
  14393.  
  14394.  
  14395.  
  14396.         WaitForKey
  14397.         Waits for a specific key to be pressed.
  14398.  
  14399.  
  14400.         Syntax:
  14401.          WaitForKey (key1, key2, key3, key4, key5)
  14402.  
  14403.         Parameters:
  14404.          (s) key1 - key5    five keystrokes to wait for.
  14405.  
  14406.         Returns:
  14407.          (i)                position of the selected keystroke (1-5).
  14408.  
  14409.         WaitForKey requires five parameters, each of which represents a
  14410.         keystroke (refer to the SendKey function for a list of special
  14411.         keycodes which can be used).  The WIL program will be suspended
  14412.         until one of the specified keys are pressed, at which time the
  14413.         WaitForKey function will return a number from 1 to 5, indicating
  14414.         the position of the "key" that was selected, and the program will
  14415.         continue.  You can specify a null string ("") for one or more of
  14416.         the "key" parameters if you don't need to use all five.
  14417.  
  14418.         WaitForKey will detect its keystrokes in most, but not all, Windows
  14419.         applications.  Any keystroke that is pressed is also passed on to
  14420.         the underlying application.
  14421.  
  14422.  
  14423.         Example:
  14424.          k = WaitForKey("{F11}", "{F12}", "{INSERT}", "", "")
  14425.          If k == 1 Then Message("WaitForKey", "You pressed the F11 key")
  14426.          If k == 2 Then Message("WaitForKey", "You pressed the F12 key")
  14427.          If k == 3 Then Message("WaitForKey", "You pressed the Insert key")
  14428.  
  14429.  
  14430.         See Also:
  14431.            IgnoreInput, IsKeyDown
  14432.  
  14433.  
  14434.  
  14435.  
  14436.  
  14437.  
  14438.  
  14439.  
  14440.  
  14441.  
  14442.  
  14443.  
  14444.  
  14445.          ________________________________________________________________
  14446.                                                                       244
  14447.  
  14448.                                                                 WallPaper
  14449.          ________________________________________________________________
  14450.  
  14451.  
  14452.  
  14453.  
  14454.         WallPaper
  14455.         Changes the Windows wallpaper.
  14456.  
  14457.  
  14458.         Syntax:
  14459.          WallPaper (bmp-name, tile)
  14460.  
  14461.  
  14462.         Parameters:
  14463.          (s) bmp-name   Name of the BMP wallpaper file.
  14464.          (i) tile       @TRUE if wallpaper should be tiled;
  14465.                         @FALSE if wallpaper should not be tiled.
  14466.  
  14467.         Returns:
  14468.          (i)            always 0.
  14469.  
  14470.         This function immediately changes the Windows wallpaper.  It can
  14471.         even be used for wallpaper "slide shows."
  14472.  
  14473.  
  14474.         Example:
  14475.          DirChange("c:\windows")
  14476.          a = FileItemize("*.bmp")
  14477.          a = ItemSelect("Select New paper", a, " ")
  14478.          tile = @FALSE
  14479.          If FileSize(a) < 40000 Then tile = @TRUE
  14480.          Wallpaper(a, tile)
  14481.  
  14482.  
  14483.         See Also:
  14484.            WinParmSet
  14485.  
  14486.  
  14487.  
  14488.  
  14489.  
  14490.  
  14491.  
  14492.  
  14493.  
  14494.  
  14495.  
  14496.  
  14497.  
  14498.  
  14499.  
  14500.  
  14501.  
  14502.  
  14503.          ________________________________________________________________
  14504.                                                                       245
  14505.  
  14506.                                                               WinActivate
  14507.          ________________________________________________________________
  14508.  
  14509.  
  14510.  
  14511.  
  14512.         WinActivate
  14513.         Activates a previously running window.
  14514.  
  14515.  
  14516.         Syntax:
  14517.          WinActivate (partial-winname)
  14518.  
  14519.         Parameters:
  14520.          (s) partial-winname     either an initial portion of, or an entire
  14521.                                  window name.  The most-recently used
  14522.                                  window whose title matches the name will
  14523.                                  be activated.
  14524.  
  14525.         Returns:
  14526.          (i)          @TRUE if a window was found to activate;
  14527.                       @FALSE if no windows were found.
  14528.  
  14529.         Use this function to activate windows for user input.
  14530.  
  14531.         This function works only with top-level (parent) application
  14532.         windows.
  14533.  
  14534.  
  14535.         Example:
  14536.          Run("notepad.exe", "")
  14537.          Run("clock.exe", "")
  14538.          WinActivate("Notepad")
  14539.  
  14540.  
  14541.         See Also:
  14542.            WinCloseNot, WinGetActive, WinName, WinShow
  14543.  
  14544.  
  14545.  
  14546.  
  14547.  
  14548.  
  14549.  
  14550.  
  14551.  
  14552.  
  14553.  
  14554.  
  14555.  
  14556.  
  14557.  
  14558.  
  14559.  
  14560.  
  14561.          ________________________________________________________________
  14562.                                                                       246
  14563.  
  14564.                                                                WinArrange
  14565.          ________________________________________________________________
  14566.  
  14567.  
  14568.  
  14569.  
  14570.         WinArrange
  14571.         Arranges, tiles, and/or stacks application windows.
  14572.  
  14573.  
  14574.         Syntax:
  14575.          WinArrange (style)
  14576.  
  14577.         Parameters:
  14578.          (i) style    one of the following: @STACK, @TILE (or @ARRANGE),
  14579.                       @ROWS, or @COLUMNS.
  14580.  
  14581.         Returns:
  14582.          (i)          always 1.
  14583.  
  14584.         Use this function to rearrange the open windows on the screen.
  14585.         (Any iconized programs are unaffected.)
  14586.  
  14587.         If there are more than four open windows and you specify @ROWS, or
  14588.         if there are more than three open windows and you specify @COLUMNS,
  14589.         @TILE will be used instead.
  14590.  
  14591.         This function works only with top-level (parent) application
  14592.         windows.
  14593.  
  14594.  
  14595.         Example:
  14596.          ; Reveal all windows
  14597.          WinArrange(@TILE)
  14598.  
  14599.  
  14600.         See Also:
  14601.            IconArrange, WinHide, WinIconize, WinItemize, WinPlace, WinShow,
  14602.            WinZoom
  14603.  
  14604.  
  14605.  
  14606.  
  14607.  
  14608.  
  14609.  
  14610.  
  14611.  
  14612.  
  14613.  
  14614.  
  14615.  
  14616.  
  14617.  
  14618.  
  14619.          ________________________________________________________________
  14620.                                                                       247
  14621.  
  14622.                                                                  WinClose
  14623.          ________________________________________________________________
  14624.  
  14625.  
  14626.  
  14627.  
  14628.         WinClose
  14629.         Closes an open window.
  14630.  
  14631.  
  14632.         Syntax:
  14633.          WinClose (partial-winname)
  14634.  
  14635.         Parameters:
  14636.          (s) partial-winname     either an initial portion of, or an entire
  14637.                                  window name.  The most-recently used
  14638.                                  window whose title matches the name will
  14639.                                  be closed.
  14640.  
  14641.         Returns:
  14642.          (i)          @TRUE if a window was found to close;
  14643.                       @FALSE if no windows were found.
  14644.  
  14645.         Use this function to close windows.
  14646.  
  14647.         WinClose will not close the window which contains the currently-
  14648.         executing WIL program.  You can, however, use EndSession to end the
  14649.         current Windows session.
  14650.  
  14651.         This function works only with top-level (parent) application
  14652.         windows.
  14653.  
  14654.  
  14655.         Example:
  14656.          Run("notepad.exe", "")
  14657.          WinClose("Notepad")
  14658.  
  14659.  
  14660.         See Also:
  14661.            EndSession, WinCloseNot, WinHide, WinIconize, WinItemize,
  14662.            WinWaitClose
  14663.  
  14664.  
  14665.  
  14666.  
  14667.  
  14668.  
  14669.  
  14670.  
  14671.  
  14672.  
  14673.  
  14674.  
  14675.  
  14676.  
  14677.          ________________________________________________________________
  14678.                                                                       248
  14679.  
  14680.                                                               WinCloseNot
  14681.          ________________________________________________________________
  14682.  
  14683.  
  14684.  
  14685.  
  14686.         WinCloseNot
  14687.         Closes all windows, except those provided as parameters.
  14688.  
  14689.  
  14690.         Syntax:
  14691.          WinCloseNot (partial-winname [, partial-winname...])
  14692.  
  14693.         Parameters:
  14694.          (s) partial-winname     either an initial portion of, or an entire
  14695.                                  window name.  Any windows whose titles
  14696.                                  match the partial names will stay open.
  14697.  
  14698.         Returns:
  14699.          (i)          always 1.
  14700.  
  14701.         Use this function to close all windows except those specifically
  14702.         listed in the parameter strings.
  14703.  
  14704.         At least one partial window name must be given.  A null-string
  14705.         parameter would match all windows, or, in other words, close
  14706.         nothing.
  14707.  
  14708.         This function works only with top-level (parent) application
  14709.         windows.
  14710.  
  14711.  
  14712.         Example:
  14713.          ; The statement below will close all windows except:
  14714.          ; 1) Program Manager (starts with 'Program')
  14715.          ; 2) Clock  (starts with 'Clo' )
  14716.          WinCloseNot("Program", "Clo")
  14717.  
  14718.  
  14719.         See Also:
  14720.            EndSession, WinClose, WinHide, WinIconize, WinItemize,
  14721.            WinWaitClose
  14722.  
  14723.  
  14724.  
  14725.  
  14726.  
  14727.  
  14728.  
  14729.  
  14730.  
  14731.  
  14732.  
  14733.  
  14734.  
  14735.          ________________________________________________________________
  14736.                                                                       249
  14737.  
  14738.                                                                 WinConfig
  14739.          ________________________________________________________________
  14740.  
  14741.  
  14742.  
  14743.  
  14744.         WinConfig
  14745.         Returns WIN3 mode flags.
  14746.  
  14747.  
  14748.         Syntax:
  14749.          WinConfig ( )
  14750.  
  14751.         Parameters:
  14752.          (none)
  14753.  
  14754.         Returns:
  14755.          (i)          sum of Windows configuration bits.
  14756.  
  14757.  
  14758.         Returns Windows configuration information as a number, which is the
  14759.         sum of the following individual bits:
  14760.  
  14761.            1    Protected Mode
  14762.            2    80286 CPU
  14763.            4    80386 CPU
  14764.            8    80486 CPU
  14765.            16   Standard Mode
  14766.            32   Enhanced Mode
  14767.            64   8086 CPU
  14768.            128  80186 CPU
  14769.            256  Large PageFrame
  14770.            512  Small PageFrame
  14771.            1024 80x87 Installed
  14772.  
  14773.         You will need to use bitwise operators to extract the individual
  14774.         bits.
  14775.  
  14776.  
  14777.         Examples:
  14778.          cfg = WinConfig()
  14779.          If cfg & 32 Then Display(2, "Windows Mode", "Enhanced Mode")
  14780.          If cfg & 16 Then Display(2, "Windows Mode", "Standard Mode")
  14781.          If !(cfg & 1) Then Display(2, "Windows Mode", "Real Mode")
  14782.  
  14783.          cfg = WinConfig()
  14784.          If cfg & 1024 Then Display(2, "Math co-processor", "Yes")
  14785.          If !(cfg & 1024) Then Display(2, "Math co-processor", "No")
  14786.  
  14787.         See Also:
  14788.            NetGetCaps, WinMetrics, WinParmGet, WinResources
  14789.  
  14790.  
  14791.  
  14792.  
  14793.          ________________________________________________________________
  14794.                                                                       250
  14795.  
  14796.                                                                WinExeName
  14797.          ________________________________________________________________
  14798.  
  14799.  
  14800.  
  14801.  
  14802.         WinExeName
  14803.         Returns the name of the executable file which created a specified
  14804.         window.
  14805.  
  14806.  
  14807.         Syntax:
  14808.          WinExeName (partial-winname)
  14809.  
  14810.         Parameters:
  14811.          (s) partial-winname     the initial part of, or an entire, window
  14812.                                  name.
  14813.  
  14814.         Returns:
  14815.          (s)                     name of the EXE file.
  14816.  
  14817.         Returns the name of the EXE file which created the first window
  14818.         found whose title matches "partial-winname".
  14819.  
  14820.         "Partial-winname" is the initial part of a window name, and may be
  14821.         a complete window name.  It is case-sensitive.  You should specify
  14822.         enough characters so that "partial-winname" matches only one
  14823.         existing window.
  14824.  
  14825.         This function works only with top-level (parent) application
  14826.         windows.
  14827.  
  14828.  
  14829.         Example:
  14830.          prog = WinExeName("WinCheck")
  14831.          WinClose("WinCheck")
  14832.          Delay(5)
  14833.          Run(prog, "")
  14834.  
  14835.  
  14836.         See Also:
  14837.            AppExist, AppWaitClose, Run, WinExist, WinGetActive, WinName
  14838.  
  14839.  
  14840.  
  14841.  
  14842.  
  14843.  
  14844.  
  14845.  
  14846.  
  14847.  
  14848.  
  14849.  
  14850.  
  14851.          ________________________________________________________________
  14852.                                                                       251
  14853.  
  14854.                                                                  WinExist
  14855.          ________________________________________________________________
  14856.  
  14857.  
  14858.  
  14859.  
  14860.         WinExist
  14861.         Tells if specified window exists.
  14862.  
  14863.  
  14864.         Syntax:
  14865.          WinExist (partial-winname)
  14866.  
  14867.         Parameters:
  14868.          (s) partial-winname     the initial part of, or an entire, window
  14869.                                  name.
  14870.  
  14871.         Returns:
  14872.          (i)          @TRUE if a matching window is found;
  14873.                       @FALSE if a matching window is not found.
  14874.  
  14875.         Note: The partial window name you give must match the initial
  14876.         portion of the window name (as appears in the title bar) exactly,
  14877.         including proper case (upper or lower) and punctuation.
  14878.  
  14879.         This function works only with top-level (parent) application
  14880.         windows.
  14881.  
  14882.  
  14883.         Example:
  14884.          If WinExist("Clock") == @FALSE Then RunIcon("Clock", "")
  14885.  
  14886.         See Also:
  14887.            AppExist, WinActivate, WinClose, WinExeName, WinGetActive,
  14888.            WinItemize, WinState
  14889.  
  14890.  
  14891.  
  14892.  
  14893.  
  14894.  
  14895.  
  14896.  
  14897.  
  14898.  
  14899.  
  14900.  
  14901.  
  14902.  
  14903.  
  14904.  
  14905.  
  14906.  
  14907.  
  14908.  
  14909.          ________________________________________________________________
  14910.                                                                       252
  14911.  
  14912.                                                              WinGetActive
  14913.          ________________________________________________________________
  14914.  
  14915.  
  14916.  
  14917.  
  14918.         WinGetActive
  14919.         Gets the title of the active window.
  14920.  
  14921.  
  14922.         Syntax:
  14923.          WinGetActive ( )
  14924.  
  14925.         Parameters:
  14926.          (none)
  14927.  
  14928.         Returns:
  14929.          (s)          title of active window.
  14930.  
  14931.         Use this function to determine which window is currently active.
  14932.  
  14933.  
  14934.         Example:
  14935.          currentwin = WinGetActive()
  14936.  
  14937.  
  14938.         See Also:
  14939.            WinActivate, WinExeName, WinItemize, WinName, WinPlaceGet,
  14940.            WinPosition, WinTitle
  14941.  
  14942.  
  14943.  
  14944.  
  14945.  
  14946.  
  14947.  
  14948.  
  14949.  
  14950.  
  14951.  
  14952.  
  14953.  
  14954.  
  14955.  
  14956.  
  14957.  
  14958.  
  14959.  
  14960.  
  14961.  
  14962.  
  14963.  
  14964.  
  14965.  
  14966.  
  14967.          ________________________________________________________________
  14968.                                                                       253
  14969.  
  14970.                                                                   WinHelp
  14971.          ________________________________________________________________
  14972.  
  14973.  
  14974.  
  14975.  
  14976.         WinHelp
  14977.         Calls a Windows help file.
  14978.  
  14979.  
  14980.         Syntax:
  14981.          WinHelp (help-file, function, keyword)
  14982.  
  14983.         Parameters:
  14984.          (s) help-file    name of the Windows help file, with an optional
  14985.                           full path.
  14986.          (s) function     function to perform (see below).
  14987.          (s) keyword      keyword to look up in the help file
  14988.                           (if applicable), or "".
  14989.  
  14990.         Returns:
  14991.          (i)              @TRUE if successful; @FALSE if unsuccessful.
  14992.  
  14993.  
  14994.         This command can be used to perform several functions from a
  14995.         Windows help (.HLP) file.  It requires that the Windows help
  14996.         program WINHELP.EXE be accessible.  The desired function is
  14997.         indicated by the "function" parameter (which is not case-
  14998.         sensitive).  The possible choices for "function" are:
  14999.  
  15000.  
  15001.  
  15002.  
  15003.  
  15004.  
  15005.  
  15006.  
  15007.  
  15008.  
  15009.  
  15010.  
  15011.  
  15012.  
  15013.  
  15014.  
  15015.  
  15016.  
  15017.  
  15018.  
  15019.  
  15020.  
  15021.  
  15022.  
  15023.  
  15024.  
  15025.          ________________________________________________________________
  15026.                                                                       254
  15027.  
  15028.                                                                   WinHelp
  15029.          ________________________________________________________________
  15030.  
  15031.            "Contents"    Brings up the Contents page for the help file.
  15032.  
  15033.            "Key"         Brings up help for the keyword specified by the
  15034.                          "keyword" parameter.  You must specify a complete
  15035.                          keyword, and it must be spelled correctly.  If
  15036.                          there is more than one occurrence of "keyword" in
  15037.                          the help file, a search box will be displayed
  15038.                          which allow you to select the desired topic from
  15039.                          the available choices.
  15040.  
  15041.            "PartialKey"  Brings up help for the keyword specified by the
  15042.                          "keyword" parameter.  You may specify a partial
  15043.                          keyword name:  if it matches more than one keyword
  15044.                          in the help file, a search box  will be displayed
  15045.                          which allow you to select the desired one from the
  15046.                          available choices.  You may also specify a null
  15047.                          string ("") for "keyword", in which case you will
  15048.                          get a search dialog containing all keywords in the
  15049.                          help file.
  15050.  
  15051.            "Command"     Executes the help macro specified by the "keyword"
  15052.                          parameter.
  15053.  
  15054.            "Quit"        Closes the WINHELP.EXE window, unless another
  15055.                          application is still using it.
  15056.  
  15057.            "HelpOnHelp"  Brings up the help file for the Windows help
  15058.                          program (WINHELP.HLP).
  15059.  
  15060.  
  15061.         For the functions which do not require a keyword (i.e., "Contents",
  15062.         "Quit", and "HelpOnHelp"), specify a null string ("") for the
  15063.         "keyword" parameter.
  15064.  
  15065.  
  15066.         Example:
  15067.          WinHelp("wil.hlp", "Key", "ItemSelect")
  15068.  
  15069.  
  15070.  
  15071.  
  15072.  
  15073.  
  15074.  
  15075.  
  15076.  
  15077.  
  15078.  
  15079.  
  15080.  
  15081.  
  15082.  
  15083.          ________________________________________________________________
  15084.                                                                       255
  15085.  
  15086.                                                                   WinHide
  15087.          ________________________________________________________________
  15088.  
  15089.  
  15090.  
  15091.  
  15092.         WinHide
  15093.         Hides a window.
  15094.  
  15095.  
  15096.         Syntax:
  15097.          WinHide (partial-winname)
  15098.  
  15099.         Parameters:
  15100.          (s) partial-winname     either an initial portion of, or an entire
  15101.                                  window name.  The most-recently used
  15102.                                  window whose title matches the name will
  15103.                                  be hidden.
  15104.  
  15105.         Returns:
  15106.          (i)          @TRUE if a window was found to hide;
  15107.                       @FALSE if no windows were found.
  15108.  
  15109.         Use this function to hide windows.  The programs are still running
  15110.         when they are hidden.
  15111.  
  15112.         A partial-window name of "" (null string) hides the window making
  15113.         the current call to the WIL Interpreter.
  15114.  
  15115.         This function works only with top-level (parent) application
  15116.         windows.
  15117.  
  15118.  
  15119.         Example:
  15120.          Run("notepad.exe", "")
  15121.          WinHide("Notepad")
  15122.          Delay(3)
  15123.          WinShow("Notepad")
  15124.  
  15125.  
  15126.         See Also:
  15127.            RunHide, WinClose, WinIconize, WinPlace
  15128.  
  15129.  
  15130.  
  15131.  
  15132.  
  15133.  
  15134.  
  15135.  
  15136.  
  15137.  
  15138.  
  15139.  
  15140.  
  15141.          ________________________________________________________________
  15142.                                                                       256
  15143.  
  15144.                                                                WinIconize
  15145.          ________________________________________________________________
  15146.  
  15147.  
  15148.  
  15149.  
  15150.         WinIconize
  15151.         Iconizes a window.
  15152.  
  15153.  
  15154.         Syntax:
  15155.          WinIconize (partial-winname)
  15156.  
  15157.         Parameters:
  15158.          (s) partial-winname     either an initial portion of, or an entire
  15159.                                  window name.  The most-recently used
  15160.                                  window whose title matches the name will
  15161.                                  be iconized.
  15162.  
  15163.         Returns:
  15164.          (i)          @TRUE if a window was found to iconize;
  15165.                       @FALSE if no windows were found.
  15166.  
  15167.         Use this function to turn a window into an icon at the bottom of
  15168.         the screen.
  15169.  
  15170.         A partial-window name of "" (null string) iconizes the current WIL
  15171.         Interpreter window.
  15172.  
  15173.         This function works only with top-level (parent) application
  15174.         windows.
  15175.  
  15176.  
  15177.         Example:
  15178.          Run("clock.exe", "")
  15179.          WinIconize("Clo")  ; partial window name used here
  15180.  
  15181.  
  15182.         See Also:
  15183.            IconArrange, RunIcon, WinClose, WinHide, WinPlace, WinShow,
  15184.            WinZoom
  15185.  
  15186.  
  15187.  
  15188.  
  15189.  
  15190.  
  15191.  
  15192.  
  15193.  
  15194.  
  15195.  
  15196.  
  15197.  
  15198.  
  15199.          ________________________________________________________________
  15200.                                                                       257
  15201.  
  15202.                                                                WinItemize
  15203.          ________________________________________________________________
  15204.  
  15205.  
  15206.  
  15207.  
  15208.         WinItemize
  15209.         Returns a tab-delimited list of all open windows.
  15210.  
  15211.  
  15212.         Syntax:
  15213.          WinItemize ( )
  15214.  
  15215.         Parameters:
  15216.          (none)
  15217.  
  15218.         Returns:
  15219.          (s)          list of the titles of all open windows.
  15220.  
  15221.         This function compiles a list of all the open application windows'
  15222.         titles and separates the titles by tabs.  This is especially useful
  15223.         in conjunction with the ItemSelect function, which enables the user
  15224.         to choose an item from such a tab-delimited list.
  15225.  
  15226.         Note this behaves somewhat differently than FileItemize and
  15227.         DirItemize, which create space-delimited lists.  This is because
  15228.         window titles regularly contain embedded spaces.
  15229.  
  15230.         This function works only with top-level (parent) application
  15231.         windows.
  15232.  
  15233.  
  15234.         Example:
  15235.          ; Find a window
  15236.          allwins = WinItemize()
  15237.          htab = Num2Char(9)
  15238.          mywind = ItemSelect("Windows", allwins, htab)
  15239.          WinActivate(mywind)
  15240.  
  15241.  
  15242.         See Also:
  15243.            DirItemize, FileItemize, ItemSelect, TextSelect, WinClose,
  15244.            WinCloseNot, WinGetActive, WinName, WinPlaceGet, WinPosition
  15245.  
  15246.  
  15247.  
  15248.  
  15249.  
  15250.  
  15251.  
  15252.  
  15253.  
  15254.  
  15255.  
  15256.  
  15257.          ________________________________________________________________
  15258.                                                                       258
  15259.  
  15260.                                                                WinMetrics
  15261.          ________________________________________________________________
  15262.  
  15263.  
  15264.  
  15265.  
  15266.         WinMetrics
  15267.         Returns Windows system information.
  15268.  
  15269.  
  15270.         Syntax:
  15271.          WinMetrics (request#)
  15272.  
  15273.         Parameters:
  15274.          (i) request#   see below.
  15275.  
  15276.         Returns:
  15277.          (i)            see below.
  15278.  
  15279.         The request# parameter determines what piece of information will be
  15280.         returned.
  15281.  
  15282.  
  15283.  
  15284.  
  15285.  
  15286.  
  15287.  
  15288.  
  15289.  
  15290.  
  15291.  
  15292.  
  15293.  
  15294.  
  15295.  
  15296.  
  15297.  
  15298.  
  15299.  
  15300.  
  15301.  
  15302.  
  15303.  
  15304.  
  15305.  
  15306.  
  15307.  
  15308.  
  15309.  
  15310.  
  15311.  
  15312.  
  15313.  
  15314.  
  15315.          ________________________________________________________________
  15316.                                                                       259
  15317.  
  15318.                                                                WinMetrics
  15319.          ________________________________________________________________
  15320.  
  15321.            Req# Return value
  15322.           -1    Number of colors supported by video driver
  15323.            0    Width of screen, in pixels
  15324.            1    Height of screen, in pixels
  15325.            2    Width of arrow on vertical scrollbar
  15326.            3    Height of arrow on horizontal scrollbar
  15327.            4    Height of window title bar
  15328.            5    Width of window border lines
  15329.            6    Height of window border lines
  15330.            7    Width of dialog box frame
  15331.            8    Height of dialog box frame
  15332.            9    Height of thumb box on scrollbar
  15333.            10   Width of thumb box on scrollbar
  15334.            11   Width of an icon
  15335.            12   Height of an icon
  15336.            13   Width of a cursor
  15337.            14   Height of a cursor
  15338.            15   Height of a one line menu bar
  15339.            16   Width of full screen window
  15340.            17   Height of a full screen window
  15341.            18   Height of Kanji window (Japanese)
  15342.            19   Is a mouse present (0 = No, 1 = Yes)
  15343.            20   Height of arrow on vertical scrollbar
  15344.            21   Width of arrow on horizontal scrollbar
  15345.            22   Is debug version of Windows running (0 = No, 1 = Yes)
  15346.            23   Are Left and Right mouse buttons swapped (0 = No, 1 = Yes)
  15347.            24   Reserved
  15348.            25   Reserved
  15349.            26   Reserved
  15350.            27   Reserved
  15351.            28   Minimum width of a window
  15352.            29   Minimum height of a window
  15353.            30   Width of bitmaps in title bar
  15354.            31   Height of bitmaps in title bar
  15355.            32   Width of sizeable window frame
  15356.            33   Height of sizeable window frame
  15357.            34   Minimum tracking width of a window
  15358.            35   Minimum tracking height of a window
  15359.  
  15360.         Example:
  15361.          mouse = "NO"
  15362.          If WinMetrics(19) == 1 Then mouse = "YES"
  15363.          Message("Is there a mouse installed?", mouse)
  15364.  
  15365.  
  15366.         See Also:
  15367.            Environment, MouseInfo, NetGetCaps, WinConfig, WinParmGet,
  15368.            WinResources
  15369.  
  15370.  
  15371.  
  15372.  
  15373.          ________________________________________________________________
  15374.                                                                       260
  15375.  
  15376.                                                                   WinName
  15377.          ________________________________________________________________
  15378.  
  15379.  
  15380.  
  15381.  
  15382.         WinName
  15383.         Returns the name of the window calling the WIL Interpreter.
  15384.  
  15385.  
  15386.         Syntax:
  15387.          WinName ( )
  15388.  
  15389.         Parameters:
  15390.          (none)
  15391.  
  15392.         Returns:
  15393.          (s)          window name.
  15394.  
  15395.         Returns the name of the window making the current call to the WIL
  15396.         Interpreter.
  15397.  
  15398.  
  15399.         Example:
  15400.          tab = Num2Char(9)
  15401.          allwins = WinItemize()
  15402.          win = ItemSelect("Close window", allwins, tab)
  15403.          If win == WinName() Then Goto nocando
  15404.          WinClose(win)
  15405.          Exit
  15406.          :nocando
  15407.          Message("Sorry", "I can't close myself")
  15408.  
  15409.  
  15410.         See Also:
  15411.            WinActivate, WinExeName, WinGetActive, WinItemize, WinTitle
  15412.  
  15413.  
  15414.  
  15415.  
  15416.  
  15417.  
  15418.  
  15419.  
  15420.  
  15421.  
  15422.  
  15423.  
  15424.  
  15425.  
  15426.  
  15427.  
  15428.  
  15429.  
  15430.  
  15431.          ________________________________________________________________
  15432.                                                                       261
  15433.  
  15434.                                                                WinParmGet
  15435.          ________________________________________________________________
  15436.  
  15437.  
  15438.  
  15439.  
  15440.         WinParmGet
  15441.         Returns system information.
  15442.  
  15443.  
  15444.         Syntax:
  15445.          WinParmGet (request#)
  15446.  
  15447.         Parameters:
  15448.          (i) request# see below.
  15449.  
  15450.         Returns:
  15451.          (s)          see below.
  15452.  
  15453.         Note: This function requires Windows 3.1 or higher.
  15454.  
  15455.         The request# parameter determines what piece of information will be
  15456.         returned.
  15457.  
  15458.           Req#   Meaning             Return value
  15459.  
  15460.            1   Beeping               0 = Off, 1 = On
  15461.            2   Mouse sensitivity     "threshold1 threshold2 speed"
  15462.            3   Border Width          Width in pixels
  15463.            4   Keyboard Speed        Keyboard Repeat rate
  15464.            5   LangDriver            name of LANGUAGE.DLL
  15465.            6   Horiz. Icon Spacing   Spacing in pixels
  15466.            7   Screen Save Timeout   Timeout in seconds
  15467.            8   Is screen saver on    0 = No, 1 = Yes
  15468.            9   Desktop Grid size     Grid Size
  15469.            10  Wallpaper BMP file    BMP file name
  15470.            11  Desktop Pattern       Pattern codes (string of 8
  15471.                                                     space-delimited nums.)
  15472.            12  Keyboard Delay        Delay in milliseconds
  15473.            13  Vert. Icon Spacing    Spacing in pixels
  15474.            14  Icon Title Wrap       0 = No, 1 = Yes
  15475.            15  MenuDropAlign         0 = Right, 1 = Left
  15476.            16  DoubleClickWidth      Allowable horiz. movement in pixels
  15477.                                      for DblClick
  15478.            17  DoubleClickHeight     Allowable vert. movement in pixels for
  15479.                                      DblClick
  15480.            18  DoubleClickSpeed      Max time in millisecs between clicks
  15481.                                      for DblClick
  15482.            19  MouseButtonSwap       0 = Not swapped, 1 = swapped
  15483.            20  Fast Task Switch      0 = Off, 1 = On
  15484.  
  15485.  
  15486.         Example:
  15487.          If WinParmGet(8) == 1 Then Message("", "Screen saver is active")
  15488.  
  15489.          ________________________________________________________________
  15490.                                                                       262
  15491.  
  15492.                                                                WinParmGet
  15493.          ________________________________________________________________
  15494.  
  15495.  
  15496.  
  15497.         See Also:
  15498.            Environment, MouseInfo, NetGetCaps, WinConfig, WinMetrics,
  15499.            WinParmSet, WinResources
  15500.  
  15501.  
  15502.  
  15503.  
  15504.  
  15505.  
  15506.  
  15507.  
  15508.  
  15509.  
  15510.  
  15511.  
  15512.  
  15513.  
  15514.  
  15515.  
  15516.  
  15517.  
  15518.  
  15519.  
  15520.  
  15521.  
  15522.  
  15523.  
  15524.  
  15525.  
  15526.  
  15527.  
  15528.  
  15529.  
  15530.  
  15531.  
  15532.  
  15533.  
  15534.  
  15535.  
  15536.  
  15537.  
  15538.  
  15539.  
  15540.  
  15541.  
  15542.  
  15543.  
  15544.  
  15545.  
  15546.  
  15547.          ________________________________________________________________
  15548.                                                                       263
  15549.  
  15550.                                                                WinParmSet
  15551.          ________________________________________________________________
  15552.  
  15553.  
  15554.  
  15555.  
  15556.         WinParmSet
  15557.         Sets system information.
  15558.  
  15559.  
  15560.         Syntax:
  15561.          WinParmSet (request#, new-value, ini-control)
  15562.  
  15563.         Parameters:
  15564.          (i) request#       see WinParmGet
  15565.          (s) new-value      see WinParmGet
  15566.          (i) ini-control    see below.
  15567.  
  15568.         Returns:
  15569.          (int)              previous value of the setting.
  15570.  
  15571.         Note: This function requires Windows 3.1 or higher.
  15572.  
  15573.         See WinParmSet for a list of valid request#'s and values.
  15574.  
  15575.         The "ini-control" parameter determines to what extent the value
  15576.         gets updated:
  15577.  
  15578.            0   Set system value in memory only for future reference
  15579.            1   Write new value to appropriate INI file
  15580.            2   Broadcast message to all applications informing them of new
  15581.                value
  15582.            3   Both 1 and 2
  15583.  
  15584.  
  15585.         Example:
  15586.          WinParmSet(9, "2", 3)   ; sets desktop grid size to 2
  15587.  
  15588.  
  15589.         See Also:
  15590.            WallPaper, WinParmGet
  15591.  
  15592.  
  15593.  
  15594.  
  15595.  
  15596.  
  15597.  
  15598.  
  15599.  
  15600.  
  15601.  
  15602.  
  15603.  
  15604.  
  15605.          ________________________________________________________________
  15606.                                                                       264
  15607.  
  15608.                                                                  WinPlace
  15609.          ________________________________________________________________
  15610.  
  15611.  
  15612.  
  15613.  
  15614.         WinPlace
  15615.         Places a window anywhere on the screen.
  15616.  
  15617.  
  15618.         Syntax:
  15619.          WinPlace (x-ulc, y-ulc, x-brc, y-brc, partial-winname)
  15620.  
  15621.         Parameters:
  15622.          (i) x-ulc             how far from the left of the screen to place
  15623.                                the upper-left corner (0-1000).
  15624.          (i) y-ulc             how far from the top of the screen to place
  15625.                                the upper-left corner (0-1000).
  15626.          (i) x-brc             how far from the left of the screen to place
  15627.                                bottom-right corner (10-1000) or @NORESIZE.
  15628.          (i) y-brc             how far from the top of the screen to place
  15629.                                the bottom-right corner (10-1000) or
  15630.                                @NORESIZE or @ABOVEICONS.
  15631.          (s) partial-winname   either an initial portion of, or an entire
  15632.                                window name.  The most-recently used window
  15633.                                whose title matches the name will be moved
  15634.                                to the new position.
  15635.  
  15636.         Returns:
  15637.          (i)          @TRUE if a window was found to move;
  15638.                       @FALSE if no windows were found.
  15639.  
  15640.         Use this function to move windows on the screen.  (You cannot,
  15641.         however, move icons or windows that have been maximized to full
  15642.         screen.)
  15643.  
  15644.         The "x-ulc", "y-ulc", "x-brc", and "y-brc" parameters are based on
  15645.         a logical screen that is 1000 points wide by 1000 points high.
  15646.  
  15647.         You can move the window without changing the width and/or height by
  15648.         specifying @NORESIZE for the "x-brc" and/or "y-brc" parameters,
  15649.         respectively.
  15650.  
  15651.         You can fix the bottom of the window to sit just above the line of
  15652.         icons along the bottom of the screen by specifying a "y-brc" of
  15653.         @ABOVEICONS.
  15654.  
  15655.         Some sample parameters:
  15656.  
  15657.            Upper left quarter of the screen:    0,    0,  500,  500
  15658.            Upper right quarter:               500,    0, 1000,  500
  15659.            Center quarter:                    250,  250,  750,  750
  15660.            Lower left eighth:                   0,  750,  500, 1000
  15661.  
  15662.  
  15663.          ________________________________________________________________
  15664.                                                                       265
  15665.  
  15666.                                                                  WinPlace
  15667.          ________________________________________________________________
  15668.  
  15669.         This function works only with top-level (parent) application
  15670.         windows.
  15671.  
  15672.  
  15673.         Example:
  15674.          WinPlace(0, 0, 200, 200, "Clock")
  15675.  
  15676.  
  15677.         See Also:
  15678.            WinArrange, WinHide, WinIconize, WinPlaceSet, WinPosition,
  15679.            WinShow, WinZoom
  15680.  
  15681.  
  15682.  
  15683.  
  15684.  
  15685.  
  15686.  
  15687.  
  15688.  
  15689.  
  15690.  
  15691.  
  15692.  
  15693.  
  15694.  
  15695.  
  15696.  
  15697.  
  15698.  
  15699.  
  15700.  
  15701.  
  15702.  
  15703.  
  15704.  
  15705.  
  15706.  
  15707.  
  15708.  
  15709.  
  15710.  
  15711.  
  15712.  
  15713.  
  15714.  
  15715.  
  15716.  
  15717.  
  15718.  
  15719.  
  15720.  
  15721.          ________________________________________________________________
  15722.                                                                       266
  15723.  
  15724.                                                               WinPlaceGet
  15725.          ________________________________________________________________
  15726.  
  15727.  
  15728.  
  15729.  
  15730.         WinPlaceGet
  15731.         Returns window coordinates.
  15732.  
  15733.  
  15734.         Syntax:
  15735.          WinPlaceGet (win-type, partial-winname)
  15736.  
  15737.         Parameters:
  15738.          (i) win-type            @ICON, @NORMAL, or @ZOOMED
  15739.          (s) partial-winname     the initial part of, or an entire, window
  15740.                                  name.
  15741.  
  15742.         Returns:
  15743.          (s)                     window coordinates (see below).
  15744.  
  15745.         This function returns the coordinates for an iconized, normal, or
  15746.         zoomed window.
  15747.  
  15748.         "Partial-winname" is the initial part of a window name, and may be
  15749.         a complete window name.  It is case-sensitive.  You should specify
  15750.         enough characters so that "partial-winname" matches only one
  15751.         existing window.  If it matches more than one window, the most
  15752.         recently accessed window which it matches will be used.
  15753.  
  15754.         The returned value is a string of either 2 or 4 numbers, as
  15755.         follows:
  15756.  
  15757.            Iconic windows   "x y"     (upper left corner of the icon)
  15758.            Normal windows   "upper-x upper-y lower-x lower-y"
  15759.            Zoomed windows   "x y"     (upper left corner of the window)
  15760.  
  15761.         All coordinates are relative to a virtual 1000x1000 screen.
  15762.  
  15763.         This function works only with top-level (parent) application
  15764.         windows.
  15765.  
  15766.  
  15767.         Examples:
  15768.          Run("clock.exe", "")
  15769.          pos = WinPlaceGet(@NORMAL, "Clock")
  15770.          Delay(2)
  15771.          WinPlaceSet(@NORMAL, "Clock", "250 250 750 750")
  15772.          Delay(2)
  15773.          WinPlaceSet(@NORMAL, "Clock", pos)
  15774.  
  15775.  
  15776.         See Also:
  15777.            WinGetActive, WinItemize, WinPlaceSet, WinPosition, WinState
  15778.  
  15779.          ________________________________________________________________
  15780.                                                                       267
  15781.  
  15782.                                                               WinPlaceSet
  15783.          ________________________________________________________________
  15784.  
  15785.  
  15786.  
  15787.  
  15788.         WinPlaceSet
  15789.         Sets window coordinates.
  15790.  
  15791.  
  15792.         Syntax:
  15793.          WinPlaceSet (win-type, partial-winname, position-string)
  15794.  
  15795.         Parameters:
  15796.          (i) win-type            @ICON, @NORMAL, or @ZOOMED
  15797.          (s) partial-winname     the initial part of, or an entire, window
  15798.                                  name.
  15799.          (s) position-string     window coordinates (see below).
  15800.  
  15801.         Returns:
  15802.          (s)                     previous coordinates.
  15803.  
  15804.         This function sets the coordinates for an iconized, normal, or
  15805.         zoomed window.  The window does not have to be in the desired state
  15806.         to set the coordinates; for example, you can set the iconized
  15807.         position for a normal window so that when the window is
  15808.         subsequently iconized, it will go to the coordinates that you've
  15809.         set.
  15810.  
  15811.         "Partial-winname" is the initial part of a window name, and may be
  15812.         a complete window name.  It is case-sensitive.  You should specify
  15813.         enough characters so that "partial-winname" matches only one
  15814.         existing window.  If it matches more than one window, the most
  15815.         recently accessed window which it matches will be used.
  15816.  
  15817.         "Position-string" is a string of either 2 or 4 numbers, as follows:
  15818.  
  15819.            Iconic windows   "x y"     (upper left corner of the icon)
  15820.            Normal windows   "upper-x upper-y lower-x lower-y"
  15821.            Zoomed windows   "x y"     (upper left corner of the window)
  15822.  
  15823.         All coordinates are relative to a virtual 1000x1000 screen.
  15824.  
  15825.         This function works only with top-level (parent) application
  15826.         windows.
  15827.  
  15828.  
  15829.         Examples:
  15830.          WinPlaceSet(@ICON, "Clock", "10 950")
  15831.  
  15832.          WinPlaceSet(@NORMAL, "Clock", "250 250 750 750")
  15833.  
  15834.          WinPlaceSet(@ZOOMED, "Clock", "-5 -5")
  15835.  
  15836.  
  15837.          ________________________________________________________________
  15838.                                                                       268
  15839.  
  15840.                                                               WinPlaceSet
  15841.          ________________________________________________________________
  15842.  
  15843.  
  15844.         See Also:
  15845.            IconArrange, WinActivate, WinArrange, WinPlace, WinPlaceGet,
  15846.            WinState
  15847.  
  15848.  
  15849.  
  15850.  
  15851.  
  15852.  
  15853.  
  15854.  
  15855.  
  15856.  
  15857.  
  15858.  
  15859.  
  15860.  
  15861.  
  15862.  
  15863.  
  15864.  
  15865.  
  15866.  
  15867.  
  15868.  
  15869.  
  15870.  
  15871.  
  15872.  
  15873.  
  15874.  
  15875.  
  15876.  
  15877.  
  15878.  
  15879.  
  15880.  
  15881.  
  15882.  
  15883.  
  15884.  
  15885.  
  15886.  
  15887.  
  15888.  
  15889.  
  15890.  
  15891.  
  15892.  
  15893.  
  15894.  
  15895.          ________________________________________________________________
  15896.                                                                       269
  15897.  
  15898.                                                               WinPosition
  15899.          ________________________________________________________________
  15900.  
  15901.  
  15902.  
  15903.  
  15904.         WinPosition
  15905.         Returns Window position.
  15906.  
  15907.  
  15908.         Syntax:
  15909.          WinPosition (partial-winname)
  15910.  
  15911.         Parameters:
  15912.          (s) partial-winname     the initial part of, or an entire, window
  15913.                                  name.
  15914.  
  15915.         Returns:
  15916.          (s)                     window coordinates, delimited by commas.
  15917.  
  15918.  
  15919.         Returns the current window position information for the selected
  15920.         window.  It returns 4 comma-separated numbers (see WinPlace for
  15921.         details).
  15922.  
  15923.         This function works only with top-level (parent) application
  15924.         windows.
  15925.  
  15926.  
  15927.         Example:
  15928.          Run("clock.exe", "")                   ; start Clock
  15929.          WinPlace(0,0,300,300, "Clock")         ; place Clock
  15930.          pos = WinPosition("Clock")             ; save position
  15931.          delay(2)
  15932.          WinPlace(200,200,300,300, "Clock")     ; move Clock
  15933.          delay(2)
  15934.          WinPlace(%pos%, "Clock")               ; restore Clock
  15935.  
  15936.  
  15937.         See Also:
  15938.            WinGetActive, WinItemize, WinPlace, WinPlaceGet, WinState
  15939.  
  15940.  
  15941.  
  15942.  
  15943.  
  15944.  
  15945.  
  15946.  
  15947.  
  15948.  
  15949.  
  15950.  
  15951.  
  15952.  
  15953.          ________________________________________________________________
  15954.                                                                       270
  15955.  
  15956.                                                              WinResources
  15957.          ________________________________________________________________
  15958.  
  15959.  
  15960.  
  15961.  
  15962.         WinResources
  15963.         Returns information on available memory and resources.
  15964.  
  15965.  
  15966.         Syntax:
  15967.          WinResources (request#)
  15968.  
  15969.         Parameters:
  15970.          (i) request#    see below
  15971.  
  15972.         Returns:
  15973.          (i)             see below.
  15974.  
  15975.         The value of request# determined the piece of information returned.
  15976.  
  15977.            Req#   Return value
  15978.  
  15979.            0  Total available memory, in bytes
  15980.            1  Theoretical maximum available memory, in bytes
  15981.            2  Percent of free system resources (lower of GDI and USER)
  15982.            3  Percent of free GDI resources
  15983.            4  Percent of free USER resources
  15984.  
  15985.  
  15986.         Example:
  15987.          mem = WinResources(0)
  15988.          Message("Available memory", "%mem% bytes")
  15989.  
  15990.  
  15991.         See Also:
  15992.            WinConfig, WinMetrics, WinParmGet
  15993.  
  15994.  
  15995.  
  15996.  
  15997.  
  15998.  
  15999.  
  16000.  
  16001.  
  16002.  
  16003.  
  16004.  
  16005.  
  16006.  
  16007.  
  16008.  
  16009.  
  16010.  
  16011.          ________________________________________________________________
  16012.                                                                       271
  16013.  
  16014.                                                                   WinShow
  16015.          ________________________________________________________________
  16016.  
  16017.  
  16018.  
  16019.  
  16020.         WinShow
  16021.         Shows a window in its "normal" state.
  16022.  
  16023.  
  16024.         Syntax:
  16025.          WinShow (partial-winname)
  16026.  
  16027.         Parameters:
  16028.          (s) partial-winname     either an initial portion of, or an entire
  16029.                                  window name.  The most-recently used
  16030.                                  window whose title matches the name will
  16031.                                  be shown.
  16032.  
  16033.         Returns:
  16034.          (i)                     @TRUE if a window was found to show;
  16035.                                  @FALSE if no windows were found.
  16036.  
  16037.         Use this function to restore a window to its "normal" size and
  16038.         position.
  16039.  
  16040.         A partial-window name of "" (null string) restores the current WIL
  16041.         interpreter window.
  16042.  
  16043.  
  16044.         Example:
  16045.          RunZoom("notepad.exe", "")
  16046.          ; other processing...
  16047.          WinShow("Notepad")
  16048.  
  16049.  
  16050.         See Also:
  16051.            WinArrange, WinHide, WinIconize, WinZoom
  16052.  
  16053.  
  16054.  
  16055.  
  16056.  
  16057.  
  16058.  
  16059.  
  16060.  
  16061.  
  16062.  
  16063.  
  16064.  
  16065.  
  16066.  
  16067.  
  16068.  
  16069.          ________________________________________________________________
  16070.                                                                       272
  16071.  
  16072.                                                                  WinState
  16073.          ________________________________________________________________
  16074.  
  16075.  
  16076.  
  16077.  
  16078.         WinState
  16079.         Returns the current state of a window.
  16080.  
  16081.  
  16082.         Syntax:
  16083.          WinState (partial-winname)
  16084.  
  16085.         Parameters:
  16086.          (s) partial-winname     the initial part of, or an entire, window
  16087.                                  name.
  16088.  
  16089.         Returns:
  16090.          (i)                     window state (see below).
  16091.  
  16092.         "Partial-winname" is the initial part of a window name, and may be
  16093.         a complete window name.  It is case-sensitive.  You should specify
  16094.         enough characters so that "partial-winname" matches only one
  16095.         existing window.  If it matches more than one window, the most
  16096.         recently accessed window which it matches will be used.
  16097.  
  16098.         Possible return values are as follows.
  16099.  
  16100.            Value Symbolic name   Meaning
  16101.  
  16102.           -1                 Specified window exists, but is hidden
  16103.            0                 Specified window does not exist
  16104.            1     @ICON       Specified window is iconic (minimized)
  16105.            2     @NORMAL     Specified window is a normal window
  16106.            3     @ZOOMED     Specified window is zoomed (maximized)
  16107.  
  16108.         This function works only with top-level (parent) application
  16109.         windows.
  16110.  
  16111.  
  16112.         Example:
  16113.          If WinState("Notepad") == @ICON Then WinShow("Notepad")
  16114.  
  16115.  
  16116.         See Also:
  16117.            Run, WinExist, WinGetActive, WinHide, WinIconize, WinItemize,
  16118.            WinPlace, WinPlaceGet, WinPlaceSet, WinPosition, WinShow,
  16119.            WinZoom
  16120.  
  16121.  
  16122.  
  16123.  
  16124.  
  16125.  
  16126.  
  16127.          ________________________________________________________________
  16128.                                                                       273
  16129.  
  16130.                                                                  WinTitle
  16131.          ________________________________________________________________
  16132.  
  16133.  
  16134.  
  16135.  
  16136.         WinTitle
  16137.         Changes the title of a window.
  16138.  
  16139.  
  16140.         Syntax:
  16141.          WinTitle (partial-winname, new-name)
  16142.  
  16143.         Parameters:
  16144.          (s) partial-winname     either an initial portion of, or an entire
  16145.                                  window name.  The most-recently used
  16146.                                  window whose title matches the name will
  16147.                                  be shown.
  16148.          (s) new-name            the new name of the window.
  16149.  
  16150.         Returns:
  16151.          (i)          @TRUE if a window was found to rename;
  16152.                       @FALSE if no windows were found.
  16153.  
  16154.         Use this function to change a window's title.
  16155.  
  16156.         A partial-window name of "" (null string) refers to the current WIL
  16157.         interpreter window.
  16158.  
  16159.         Warning:  Some applications may rely upon their window's title
  16160.         staying the same!  Therefore, the WinTitle function should be used
  16161.         with caution and adequate testing.
  16162.  
  16163.         This function works only with top-level (parent) application
  16164.         windows.
  16165.  
  16166.  
  16167.         Example:
  16168.          ; Capitalize title of window
  16169.          htab = Num2Char(9)
  16170.          allwinds = WinItemize()
  16171.          mywin = ItemSelect("Uppercase Windows", allwinds, htab)
  16172.          WinTitle(mywin, StrUpper(mywin))
  16173.          Drop(htab, allwinds, mywin)
  16174.  
  16175.  
  16176.         See Also:
  16177.            WinGetActive, WinItemize, WinName
  16178.  
  16179.  
  16180.  
  16181.  
  16182.  
  16183.  
  16184.  
  16185.          ________________________________________________________________
  16186.                                                                       274
  16187.  
  16188.                                                                WinVersion
  16189.          ________________________________________________________________
  16190.  
  16191.  
  16192.  
  16193.  
  16194.         WinVersion
  16195.         Provides the version number of the current Windows system.
  16196.  
  16197.  
  16198.         Syntax:
  16199.          WinVersion (level)
  16200.  
  16201.         Parameters:
  16202.          (i) level    either @MAJOR or @MINOR.
  16203.  
  16204.         Returns:
  16205.          (i)          either major or minor part of the Windows version
  16206.                       number.
  16207.  
  16208.         Use this command to determine which version of Windows is currently
  16209.         running.
  16210.  
  16211.         @MAJOR returns the integer part of the Windows version number; i.e.
  16212.         1.0, 2.11, 3.0, etc.
  16213.  
  16214.         @MINOR returns the decimal part of the Windows version number; i.e.
  16215.         1.0, 2.11, 3.0, etc.
  16216.  
  16217.  
  16218.         Example:
  16219.          minorver = WinVersion(@MINOR)
  16220.          majorver = WinVersion(@MAJOR)
  16221.          Message("Windows Version", StrCat(majorver, ".", minorver))
  16222.  
  16223.  
  16224.         See Also:
  16225.            Version, DOSVersion
  16226.  
  16227.  
  16228.  
  16229.  
  16230.  
  16231.  
  16232.  
  16233.  
  16234.  
  16235.  
  16236.  
  16237.  
  16238.  
  16239.  
  16240.  
  16241.  
  16242.  
  16243.          ________________________________________________________________
  16244.                                                                       275
  16245.  
  16246.                                                              WinWaitClose
  16247.          ________________________________________________________________
  16248.  
  16249.  
  16250.  
  16251.  
  16252.         WinWaitClose
  16253.         Suspends the WIL program execution until a specified window has
  16254.         been closed.
  16255.  
  16256.  
  16257.         Syntax:
  16258.          WinWaitClose (partial-winname)
  16259.  
  16260.         Parameters:
  16261.          (s) partial-winname     either an initial portion of, or an entire
  16262.                                  window name.  WinWaitClose suspends
  16263.                                  execution until all matching windows have
  16264.                                  been closed.
  16265.  
  16266.         Returns:
  16267.          (i)          @TRUE if at least one window was found to wait for;
  16268.                       @FALSE if no windows were found.
  16269.  
  16270.         Use this function to suspend the WIL program's execution until the
  16271.         user has finished using a given window and has manually closed it.
  16272.  
  16273.         This function works only with top-level (parent) application
  16274.         windows.
  16275.  
  16276.  
  16277.         Example:
  16278.          Run("clock.exe", "")
  16279.          Display(4, "Note", "Close Clock to continue")
  16280.          WinWaitClose("Clock")
  16281.          Message("Continuing...", "Clock closed")
  16282.  
  16283.  
  16284.         See Also:
  16285.            Delay, RunWait, WinExist, Yield
  16286.  
  16287.  
  16288.  
  16289.  
  16290.  
  16291.  
  16292.  
  16293.  
  16294.  
  16295.  
  16296.  
  16297.  
  16298.  
  16299.  
  16300.  
  16301.          ________________________________________________________________
  16302.                                                                       276
  16303.  
  16304.                                                                   WinZoom
  16305.          ________________________________________________________________
  16306.  
  16307.  
  16308.  
  16309.  
  16310.         WinZoom
  16311.         Maximizes a window to full-screen.
  16312.  
  16313.  
  16314.         Syntax:
  16315.          WinZoom (partial-winname)
  16316.  
  16317.         Parameters:
  16318.          (s) partial-winname     either an initial portion of, or an entire
  16319.                                  window name.  The most-recently used
  16320.                                  window whose title matches the name will
  16321.                                  be shown.
  16322.  
  16323.         Returns:
  16324.          (i)                     @TRUE if a window was found to zoom;
  16325.                                  @FALSE if no windows were found.
  16326.  
  16327.         Use this function to "zoom" windows to full screen size.
  16328.  
  16329.         A partial-window name of "" (null string) zooms the current WIL
  16330.         interpreter window.
  16331.  
  16332.         This function works only with top-level (parent) application
  16333.         windows.
  16334.  
  16335.  
  16336.         Example:
  16337.          Run("notepad.exe", "")
  16338.          WinZoom("Notepad")
  16339.          Delay(3)
  16340.          WinShow("Notepad")
  16341.  
  16342.  
  16343.         See Also:
  16344.            RunZoom, WinHide, WinIconize, WinPlace, WinShow
  16345.  
  16346.  
  16347.  
  16348.  
  16349.  
  16350.  
  16351.  
  16352.  
  16353.  
  16354.  
  16355.  
  16356.  
  16357.  
  16358.  
  16359.          ________________________________________________________________
  16360.                                                                       277
  16361.  
  16362.                                                                     Yield
  16363.          ________________________________________________________________
  16364.  
  16365.  
  16366.  
  16367.  
  16368.         Yield
  16369.         Provides time for other windows to do processing.
  16370.  
  16371.  
  16372.         Syntax:
  16373.          Yield
  16374.  
  16375.         Parameters:
  16376.          (none)
  16377.  
  16378.         Returns:
  16379.          (not applicable)
  16380.  
  16381.         Use this command to give other running windows time to process.
  16382.         This command will allow each open window to process 20 or more
  16383.         messages.
  16384.  
  16385.  
  16386.         Example:
  16387.          ; run Excel and give it some time to start up
  16388.          sheet = AskLine ("Excel", "File to run:", "")
  16389.          Run("excel.exe", sheet)
  16390.          Yield
  16391.          Yield
  16392.          Yield
  16393.  
  16394.  
  16395.         See Also:
  16396.            Delay, Exclusive
  16397.  
  16398.  
  16399.  
  16400.  
  16401.  
  16402.  
  16403.  
  16404.  
  16405.  
  16406.  
  16407.  
  16408.  
  16409.  
  16410.  
  16411.  
  16412.  
  16413.  
  16414.  
  16415.  
  16416.  
  16417.          ________________________________________________________________
  16418.                                                                       278
  16419.  
  16420.                                         APPENDIX A - PREDEFINED CONSTANTS
  16421.          ________________________________________________________________
  16422.  
  16423.  
  16424.                                      APPENDIX A
  16425.  
  16426.                                 Predefined Constants
  16427.  
  16428.         WIL provides you with a number of predefined integer constants to
  16429.         help make your WIL programs more mnemonic:
  16430.  
  16431.  
  16432.         Logical Conditions                  String Handling
  16433.         @FALSE                              @FWDSCAN
  16434.         @NO                                 @BACKSCAN
  16435.         @OFF
  16436.         @TRUE                               Menu Handling
  16437.         @YES                                @ENABLE
  16438.         @ON                                 @DISABLE
  16439.                                             @UNCHECK
  16440.         Window Arranging                    @CHECK
  16441.         @NORESIZE
  16442.         @ABOVEICONS                         System Control
  16443.         @STACK                              @MAJOR
  16444.         @ARRANGE                            @MINOR
  16445.         @TITLE
  16446.         @ROWS                               Error Handling
  16447.         @COLUMNS                            @CANCEL
  16448.                                             @NOTIFY
  16449.         Window Status                       @OFF
  16450.         @NORMAL
  16451.         @ZOOMED                             Keyboard Status
  16452.         @ICON                               @SHIFT
  16453.         @HIDDEN                             @CTRL
  16454.  
  16455.         Menu Handling                       Debug Control
  16456.         @CHECK                              @PARSEONLY
  16457.         @UNCHECK
  16458.         @DISABLE                            INI File Management
  16459.         @ENABLE                             @WHOLESECTION
  16460.  
  16461.  
  16462.  
  16463.  
  16464.  
  16465.  
  16466.  
  16467.  
  16468.  
  16469.  
  16470.  
  16471.  
  16472.  
  16473.  
  16474.  
  16475.          ________________________________________________________________
  16476.                                                                       279
  16477.  
  16478.                                                       APPENDIX B - ERRORS
  16479.          ________________________________________________________________
  16480.  
  16481.  
  16482.                                      APPENDIX B
  16483.  
  16484.                                        Errors
  16485.  
  16486.         If the current error mode is @CANCEL (the default), any WIL errors
  16487.         encountered while processing a WIL program cause the item to be
  16488.         canceled with an error message.
  16489.  
  16490.  
  16491.  
  16492.  
  16493.         Minor Errors
  16494.         Minor errors are ignored if the current error mode has been set to
  16495.         @OFF.  If the error mode is @NOTIFY the user has the option of
  16496.         continuing with the WIL program or canceling it.
  16497.  
  16498.         1006 File Copy/Move: No matching files found
  16499.         1017 File Delete: No matching files found
  16500.         1018 File Delete: Delete Failed
  16501.         1024 File Rename: No matching files found
  16502.         1025 File Rename: Rename failed
  16503.         1028 LogDisk: Requested drive not online
  16504.         1029 DirMake: Dir not created
  16505.         1030 DirRemove: Dir not removed
  16506.         1031 DirChange: Dir not found/changed
  16507.         1039 WinClose: Window not found
  16508.         1040 WinHide: Window not found
  16509.         1041 WinIconize: Window not found
  16510.         1042 WinZoom: Window not found
  16511.         1043 WinShow: Window not found
  16512.         1044 WinPlace: Window not found
  16513.         1045 WinActivate: Window not found
  16514.         1077 FileOpen: Open failed
  16515.         1083 FileAttrGet: File not found
  16516.         1086 FileAttrSet: File not found or access denied
  16517.         1100 StrIndex/StrScan 3rd parameter out of bounds
  16518.         1119 WinPosition: Window not found
  16519.         1121 WinTitle: Window not found
  16520.         1125 FileTimeGet: File not found
  16521.         1128 FileTimeTouch: File not found
  16522.         1150 DDEExec: DDE Post failed
  16523.         1155 DDEReq: DDE Post failed
  16524.         1163 DDEPoke: DDE Post failed
  16525.         1164 DDEPoke: DDE Timeout
  16526.         1165 DDEReq: DDE Timeout
  16527.         1166 DDEExec: DDE Timeout
  16528.         1172 WinExeName: Window not found
  16529.         1173 Net: No network found
  16530.         1174 Net: Security Violation
  16531.         1175 Net: Function not supported
  16532.  
  16533.          ________________________________________________________________
  16534.                                                                       281
  16535.  
  16536.                                                       APPENDIX B - ERRORS
  16537.          ________________________________________________________________
  16538.  
  16539.         1176 Net: Out of Memory
  16540.         1177 Net: Network Error
  16541.         1178 Net: Windows function failed
  16542.         1179 Net: Invalid type of request
  16543.         1180 Net: Invalid Pointer
  16544.         1181 Net: Cancelled at users request
  16545.         1182 Net: Bad user / Not logged in
  16546.         1183 Net: Buffer too small - Internal Error
  16547.         1184 Net: Invalid Network name
  16548.         1185 Net: Invalid Local Name
  16549.         1186 Net: Invalid Password
  16550.         1187 Net: Local Device already connected
  16551.         1188 Net: Not a valid local device or network name
  16552.         1189 Net: Not a redirected local device or current net name
  16553.         1190 Net: Files were open with FORCE=FALSE
  16554.         1191 Net: Function busy
  16555.         1192 Net: Unknown network error
  16556.         1193 Function not supported in this version of Windows
  16557.         1194 PlaySounds: File not found
  16558.         1195 PlayMedia: Unrecognised Error
  16559.         1200 WinPlaceGet/Set: Window not found
  16560.         1201 WinPlaceGet/Set: Function failed
  16561.         1207 SnapShot: Out of memory
  16562.         1208 SnapShot: Palette Creation Error
  16563.         1209 SnapShot: Cannot open clipboard
  16564.         1213 Cmd Extender: Minor error occurred
  16565.         1216 RunWait Commands not supported in 3.0 Debug Windows
  16566.         1217 WinHelp: Invalid SubCommand Requested
  16567.  
  16568.  
  16569.  
  16570.         Moderate Errors
  16571.         If the error mode is @NOTIFY or @OFF, the user has the option of
  16572.         continuing with the WIL program or canceling it.
  16573.  
  16574.         2001 SendKey: Illegal Parameters
  16575.         2002 File Copy/Move: 'From' file illegal
  16576.         2003 File Copy/Move: 'To'   file illegal
  16577.         2004 File Copy/Move: Cannot put wildcards into fixed root
  16578.         2005 File Copy/Move: Cannot put wildcards into fixed extension
  16579.         2007 File Move: Unable to rename source file
  16580.         2016 File Delete: File name illegal
  16581.         2019 File Rename: 'From' file illegal
  16582.         2020 File Rename: 'To' file illegal
  16583.         2021 File Rename: Can't change disk drives. Use MOVE instead.
  16584.         2022 File Rename: Cannot put wildcards into a fixed root
  16585.         2023 File Rename: Cannot put wildcards into a fixed extension
  16586.         2038 WinCloseNot Function Syntax error
  16587.         2058 StrCat: Function syntax error
  16588.         2060 AVERAGE function syntax error
  16589.         2093 Dialog Box: Bad Filespec, using *.*
  16590.  
  16591.          ________________________________________________________________
  16592.                                                                       282
  16593.  
  16594.                                                       APPENDIX B - ERRORS
  16595.          ________________________________________________________________
  16596.  
  16597.         2106 SetDisplay: Type not NAME, DATE, SIZE, KIND or UNSORTED
  16598.         2112 FileSize: File Not Found
  16599.         2118 FileCopy/Move: Destination file same as source
  16600.         2120 SetDisplay: Display type not SHORT or LONG
  16601.         2122 FileAppend: Target cannot be wildcarded
  16602.         2203 Dir Rename: 'From' file illegal
  16603.         2204 Dir Rename: 'To' file illegal
  16604.         2214 Cmd Extender: Moderate Error Occurred
  16605.  
  16606.  
  16607.  
  16608.         Fatal Errors
  16609.         Fatal errors cause the current WIL program to be canceled with an
  16610.         error message, regardless of the error mode in effect.  (We show
  16611.         the error codes here for consistency, but in practice you will
  16612.         never be able to call LastError after a fatal error.)
  16613.  
  16614.         3008 File Copy/Move: 'From' file open error
  16615.         3009 SendKey: Could not open DEBUG TEXT file
  16616.         3010 SendKey: Could not install hook - Already Active??
  16617.         3011 File Copy/Move: 'From' file length error
  16618.         3012 File Copy/Move: No room left on disk.  Out of space??
  16619.         3013 File Copy/Move: 'To' file open error
  16620.         3014 File Copy/Move: I/O Error
  16621.         3015 File Move:  Unable to remove source file
  16622.         3026 LogDisk: Illegal disk drive
  16623.         3027 LogDisk: DOS reports no disks!!  ???
  16624.         3032 GoTo unable to lock memory for batch file
  16625.         3033 GoTo label not found
  16626.         3034 Clipboard owned by another app.  Cannot open.
  16627.         3035 Clipboard does not contain text for CLIPAPPEND.
  16628.         3036 Clipboard cannot hold that much text (>64000 bytes)
  16629.         3037 Unable to get memory for clipboard.  Close some apps
  16630.         3046 Internal Error 3046. Function not defined
  16631.         3047 Variable name over 30 chars. Too Long
  16632.         3048 Substitution %Variable% not followed by a % (Use %% for %)
  16633.         3049 No variables exist??!!
  16634.         3050 Undefined variable
  16635.         3051 Undefined variable or function
  16636.         3052 Uninitialized variable or undefined function
  16637.         3053 Character string too long (>256 chars??)
  16638.         3054 Unrecognizable item found on line
  16639.         3055 Variable name over 30 chars. Too Long
  16640.         3056 Variable could not be converted to string
  16641.         3057 Variable could not be converted to integer
  16642.         3059 Illegal Bounds for STRSUB function
  16643.         3061 Illegal Syntax
  16644.         3062 Attempt to divide by zero
  16645.         3063 Internal Error 3063. Binary op not found
  16646.         3064 Internal Error 3064. Unary op not found
  16647.         3065 Unbalanced Parenthesis
  16648.  
  16649.          ________________________________________________________________
  16650.                                                                       283
  16651.  
  16652.                                                       APPENDIX B - ERRORS
  16653.          ________________________________________________________________
  16654.  
  16655.         3066 Wrong Number of Arguments in Function
  16656.         3067 Function Syntax. Opening parenthesis missing.
  16657.         3068 Function Syntax. Illegal delimiter found.
  16658.         3069 Bad assignment statement. (Use == for equality testing)
  16659.         3070 Internal error 3070.  Too many arguments defined.
  16660.         3071 Missing or incomplete statement
  16661.         3072 THEN not found in IF statement
  16662.         3073 Goto Label not specified
  16663.         3074 Expression continues past expected end.
  16664.         3075 Call: Parse of file/parameter line failed
  16665.         3076 FileOpen: READ or WRITE not properly specified
  16666.         3078 FileOpen: Too many (>5) files open
  16667.         3079 FileClose: Invalid file handle
  16668.         3080 FileClose: File not currently open
  16669.         3081 FileRead: Invalid file handle
  16670.         3082 FileRead: File not currently open
  16671.         3084 FileWrite: Invalid file handle
  16672.         3085 FileWrite: File not currently open
  16673.         3087 FileRead:  File not open for reading
  16674.         3088 FileRead: Attempt to read past end of file
  16675.         3089 FileWrite: File not open for writing
  16676.         3090 Dialog Box: File open error
  16677.         3091 Dialog Box: Box too large (20x60 max)
  16678.         3092 Dialog Box: Non-text control used w/filebox.
  16679.         3094 Dialog Box: Window Registration Failed
  16680.         3095 Compare: Not an integer or string compare
  16681.         3096 Memory allocation failure.  Out of memory for strings
  16682.         3097 Memory allocation failure.  Out of memory for variables
  16683.         3098 IntErr: NULL pointer passed to xstrxxx subroutines
  16684.         3099 CallExt function disabled.  Not currently available.
  16685.         3101 Substituted line too long. (> 256 characters)
  16686.         3102 Drop: Can only drop variables
  16687.         3103 IsDefined: Attempting to test non-variable item
  16688.         3104 Dialog Box: Window Creation Failed
  16689.         3105 CALL and CALLEXT not supported in compiled versions
  16690.         3107 Run:  Filetype is not COM, EXE, PIF or BAT
  16691.         3108 FileItemize: Unable to lock file info segment
  16692.         3109 FileItemize: Unable to unlock file info segment
  16693.         3110 FileItemize: Unable to lock file index segment
  16694.         3111 FileItemize: Unable to unlock file index segment
  16695.         3113 FileSize: Filelength I/O Error
  16696.         3114 FileSize: Buffer Overrun Error
  16697.         3115 FileDelete: Buffer Overrun Error
  16698.         3116 FileRename: Buffer Overrun Error
  16699.         3117 FileCopy/Move: Buffer Overrun Error
  16700.         3123 WaitForKey: Invalid key codes specified
  16701.         3124 WinMetrics: Invalid code
  16702.         3126 FileAttrSet: Buffer Overrun Error
  16703.         3127 FileTimeTouch: Buffer Overrun Error
  16704.         3138 DDE: Too many DDE conversations
  16705.         3139 DDEInitiate: Client window create failed
  16706.  
  16707.          ________________________________________________________________
  16708.                                                                       284
  16709.  
  16710.                                                       APPENDIX B - ERRORS
  16711.          ________________________________________________________________
  16712.  
  16713.         3140 DDEInitiate: GlobalAddAtom failure
  16714.         3142 DDETerminate: Channel does not exist
  16715.         3144 DDETerminate: Internal Error 3144
  16716.         3145 DDEExec: GlobalAlloc failed
  16717.         3146 DDEExec: Global Lock failed
  16718.         3147 DDEExec: Bad channel number
  16719.         3149 DDEExec: Internal Error 3149
  16720.         3154 DDEReq: GlobalAddAtom failed
  16721.         3156 DDEReq: GlobalLock failed
  16722.         3160 DDEPoke: GlobalAlloc failed
  16723.         3161 DDEPoke: GlobalAddAtom failed
  16724.         3162 DDEPoke: GlobalLock failed
  16725.         3167 DDE Recv Data: GlobalLock 1 failed
  16726.         3168 DDE Recv Data: GlobalAlloc 2 failed
  16727.         3169 DDE Recv Data: GlobalLock 2 failed
  16728.         3170 DDEInitiate: Internal Error 3170
  16729.         3171 IntControl: Invalid IntControl opcode
  16730.         3196 PlayMedia: Do not use WAIT or NOTIFY in MCI string
  16731.         3197 WinResources: Invalid request number
  16732.         3198 WinParmGet/Set: Invalid request number
  16733.         3199 WinPlaceGet/Set: Invalid window-size number
  16734.         3202 WinPlaceSet: Wrong number of window co-ordinates
  16735.         3205 MouseInfo: Invalid request number
  16736.         3206 SnapShot: Invalid request number
  16737.         3210 Cmd Extender: Out of memory to save result
  16738.         3211 Call:  More than 6 levels of Calls
  16739.         3212 PlayMedia: Notify Window creation failed
  16740.         3215 Cmd Extender: Severe error occurred
  16741.         3218 Dialog: Dialog name too long (>16 chars)
  16742.         3219 Dialog: Format variable missing
  16743.         3220 Dialog: Format version not supported
  16744.         3221 Dialog: x, y, width or height variables bad
  16745.         3222 Dialog: Control definition variable missing
  16746.         3223 Dialog: Bad Control type in definition variable
  16747.         3224 Dialog: Bad or missing Value for Radio/Checkbox button
  16748.         3225 Dialog: Too many items in definition variable
  16749.  
  16750.  
  16751.  
  16752.  
  16753.  
  16754.  
  16755.  
  16756.  
  16757.  
  16758.  
  16759.  
  16760.  
  16761.  
  16762.  
  16763.  
  16764.  
  16765.          ________________________________________________________________
  16766.                                                                       285
  16767.  
  16768.  
  16769.                                                      APPENDIX C - BROWSER
  16770.          ________________________________________________________________
  16771.  
  16772.  
  16773.                                      APPENDIX C
  16774.  
  16775.                                       Browser
  16776.  
  16777.         The Browser program lets you view a file's contents in a variety of
  16778.         ways.
  16779.  
  16780.         The default is to show the file in Windows' "ANSI text" mode:
  16781.  
  16782.  
  16783.         File
  16784.         These menu items let you open a new file to view, re-read the
  16785.         current file, and perform other housekeeping functions including
  16786.         exiting the program.
  16787.  
  16788.  
  16789.         Hide & Seek
  16790.         Browser gives you the ability to filter which lines you view with
  16791.         its Hide & Seek commands.  You can hide or show specific lines by
  16792.         entering a word to look for.
  16793.  
  16794.  
  16795.         Clip Copy
  16796.         Lets you copy portions of the file into the Windows Clipboard.
  16797.  
  16798.  
  16799.         Clip Append
  16800.         Lets you add portions of the file onto the end of the Windows
  16801.         Clipboard.
  16802.  
  16803.  
  16804.         Options
  16805.         These menu items let you change how you view the file; changing for
  16806.         example between ASCII text mode (which interprets some special
  16807.         characters differently than ANSI text) and hex-dump formats.
  16808.  
  16809.  
  16810.  
  16811.  
  16812.  
  16813.  
  16814.  
  16815.  
  16816.  
  16817.  
  16818.  
  16819.  
  16820.  
  16821.          ________________________________________________________________
  16822.                                                                       286
  16823.  
  16824.  
  16825.                                                                     INDEX
  16826.          ________________________________________________________________
  16827.  
  16828.  
  16829.                                        INDEX
  16830.  
  16831.  
  16832.         A
  16833.         Abs  61, 67-69
  16834.         AppExist  69-70
  16835.         AppWaitClose  70-71
  16836.         AskLine  23, 54, 69-73
  16837.         AskPassword  73-74
  16838.         AskYesNo  22, 54, 74-75
  16839.         Average  61, 75-76
  16840.  
  16841.         B
  16842.         Beep  23, 54, 76-77
  16843.         Browser  286
  16844.         ButtonNames  77-78
  16845.  
  16846.         C
  16847.         Call  61, 78-80
  16848.         Char2Num  59, 80-81
  16849.         ClipAppend  61, 81-82
  16850.         ClipGet  61, 82-83
  16851.         ClipPut  61, 83-84
  16852.         Comments  50-51
  16853.         Conditional Branching
  16854.           see also   Terminate
  16855.         Constants  46-48
  16856.           predefined  47-48
  16857.         CurrentFile  84-85
  16858.  
  16859.         D
  16860.         DateTime  63, 85-87
  16861.         DDEExecute  87-88
  16862.         DDEInitiate  88-89
  16863.         DDEPoke  89-90
  16864.         DDERequest  90-91
  16865.         DDETerminate  91-92
  16866.         DDETimeout  92-93
  16867.         Debug  61, 93-96
  16868.         Delay  23, 62, 96-97
  16869.         Dialog  54, 97-102
  16870.         DialogBox  54, 102-4
  16871.         DirChange  28, 56, 104-5
  16872.         Directory Management
  16873.           in WIL  56-57
  16874.         DirGet  28, 57, 105-6
  16875.         DirHome  57, 106-7
  16876.         DirItemize  34, 57, 107-8
  16877.          ________________________________________________________________
  16878.                                                                       287
  16879.  
  16880.  
  16881.                                                                     INDEX
  16882.          ________________________________________________________________
  16883.  
  16884.         DirMake  57, 108-9
  16885.         DirRemove  57, 109-10
  16886.         DirRename  57, 110-11
  16887.         DirWindows  111-12
  16888.         DiskFree  57, 112-13
  16889.         DiskScan  113-14
  16890.         Display  21, 54, 114-15
  16891.         DOSVersion  63, 115-16
  16892.         Drop  62, 116-17
  16893.  
  16894.         E
  16895.         Else  117-18
  16896.         EndSession  28, 62, 117-19
  16897.         Environment  38, 63, 119-20
  16898.         ErrorMode  31, 62, 120-21
  16899.         Errors  53-54, 279-83
  16900.           fatal  282-83
  16901.           minor  281
  16902.           moderate  281-82
  16903.           see also   Debug,  ErrorMode,  LastError
  16904.         Exclusive  62, 121-22
  16905.         Execute  62, 122-23
  16906.         Exit  62, 123-24
  16907.  
  16908.         F
  16909.         File Management  28
  16910.           in WIL  55-56
  16911.         FileAppend  55, 124-25
  16912.         FileAttrGet  125-26
  16913.         FileAttrSet  126-27
  16914.         FileClose  55, 127-28
  16915.         FileCopy  29, 55, 128-29
  16916.         FileDelete  29, 55, 129-30
  16917.         FileExist  28, 55, 130-31
  16918.         FileExtension  55, 131-32
  16919.         FileItemize  32, 55, 132-33
  16920.         FileLocate  55, 133-34
  16921.         FileMove  55, 134-35
  16922.         FileOpen  55, 135-36
  16923.         FilePath  55, 136-37
  16924.         FileRead  56, 137-38
  16925.         FileRename  29, 56, 138-39
  16926.         FileRoot  56, 139-40
  16927.         FileSize  56, 140-41
  16928.         FileTimeGet  141-42
  16929.         FileTimeTouch  142-43
  16930.         FileWrite  56, 143-44
  16931.  
  16932.         G
  16933.          ________________________________________________________________
  16934.                                                                       288
  16935.  
  16936.  
  16937.                                                                     INDEX
  16938.          ________________________________________________________________
  16939.  
  16940.         Goto  18, 62, 144-45
  16941.  
  16942.         I
  16943.         IconArrange  145-46
  16944.         Identifiers  48
  16945.         If ... Then  16, 146-47
  16946.         IgnoreInput  62, 147-48
  16947.         IniDelete  148-49
  16948.         IniDeletePvt  149-50
  16949.         IniItemize  150-51
  16950.         IniItemizePvt  151-52
  16951.         IniRead  56, 152-53
  16952.         IniReadPvt  56, 153-54
  16953.         IniWrite  56, 154-55
  16954.         IniWritePvt  56, 155-56
  16955.         IntControl  156-59
  16956.         IsDefined  62, 159-60
  16957.         IsKeyDown  62, 160-61
  16958.         IsLicensed  64, 161-62
  16959.         IsMenuChecked  162-63
  16960.         IsMenuEnabled  163-64
  16961.         IsNumber  59, 164-65
  16962.         ItemCount  59, 165-66
  16963.         ItemExtract  60, 166-67
  16964.         ItemInsert  167-68
  16965.         ItemLocate  168-69
  16966.         ItemRemove  169-70
  16967.         ItemSelect  33, 54, 167-72
  16968.         ItemSort  172-73
  16969.  
  16970.         K
  16971.         Keywords  48-49
  16972.  
  16973.         L
  16974.         LastError  62, 172-74
  16975.         LogDisk  57, 174-75
  16976.  
  16977.         M
  16978.         Max  61, 175-76
  16979.         menu files
  16980.           menu structure  45
  16981.           menuitems  45-46
  16982.         MenuChange  176-77
  16983.         Message  22, 54, 177-78
  16984.         Microsoft Windows
  16985.           date & time formatting  85
  16986.           determining the version  64, 275-76
  16987.         Min  61, 178-79
  16988.         MouseInfo  179-81
  16989.          ________________________________________________________________
  16990.                                                                       289
  16991.  
  16992.  
  16993.                                                                     INDEX
  16994.          ________________________________________________________________
  16995.  
  16996.  
  16997.         N
  16998.         NetAddCon  181-82
  16999.         NetAttach  182-83
  17000.         NetBrowse  182-84
  17001.         NetCancelCon  184-85
  17002.         NetDetach  185-86
  17003.         NetDialog  185-86
  17004.         NetGetCaps  186-89
  17005.         NetGetCon  189-90
  17006.         NetGetUser  190-91
  17007.         NetLogin  191-92
  17008.         NetLogout  191-93
  17009.         NetMapRoot  193-94
  17010.         NetMemberGet  194-95
  17011.         NetMemberSet  195-96
  17012.         NetMsgAll  196-97
  17013.         NetMsgSend  197-98
  17014.         Num2Char  36, 60, 191-99
  17015.  
  17016.         O
  17017.         Operators  49-50
  17018.           Precedence  50
  17019.  
  17020.         P
  17021.         Parameters
  17022.           function  52-53
  17023.         ParseData  60, 199-200
  17024.         Pause  22, 54, 200-201
  17025.         PlayMedia  201-3
  17026.         PlayMidi  203-4
  17027.         PlayWaveForm  204-6
  17028.  
  17029.         R
  17030.         Random  61, 206-7
  17031.         Reload  207-8
  17032.         Return  62, 207-9
  17033.         Run  20, 59, 213-15
  17034.         RunHide  59, 211
  17035.         RunHideWait  211-12
  17036.         RunIcon  21, 59, 213-14
  17037.         RunIconWait  213-14
  17038.         Running programs  20
  17039.           DOS programs  38
  17040.           in WIL  59
  17041.         RunWait  213-15
  17042.         RunZoom  21, 59, 213-16
  17043.         RunZoomWait  216-17
  17044.  
  17045.          ________________________________________________________________
  17046.                                                                       290
  17047.  
  17048.  
  17049.                                                                     INDEX
  17050.          ________________________________________________________________
  17051.  
  17052.  
  17053.         S
  17054.         Sample WBT file  40
  17055.         SendKey  39, 63, 216-20
  17056.         SKDebug  62, 220-21
  17057.         SnapShot  221-22
  17058.         Sounds  222-23
  17059.         Statements  51
  17060.           reference  63-278
  17061.         StrCat  37, 60, 223-24
  17062.         StrCmp  60, 224-25
  17063.         StrFill  60, 225-26
  17064.         StrFix  60, 226-27
  17065.         StriCmp  60, 227-28
  17066.         StrIndex  60, 228-29
  17067.         StrLen  60, 229-30
  17068.         StrLower  60, 230-31
  17069.         StrReplace  60, 231-32
  17070.         StrScan  60, 232-33
  17071.         StrSub  61, 233-34
  17072.         StrTrim  61, 234-35
  17073.         StrUpper  61, 235-36
  17074.         Substitution  51-52
  17075.           and StrCat  223-24
  17076.  
  17077.         T
  17078.         Terminate  236-37
  17079.         TextBox  54, 55, 237-39
  17080.         TextBoxSort  239-40
  17081.         TextSelect  239-41
  17082.         Then  241-42
  17083.  
  17084.         V
  17085.         Variables  16, 48
  17086.         Version  64, 241-43
  17087.         VersionDLL  243-44
  17088.  
  17089.         W
  17090.         WaitForKey  243-45
  17091.         WallPaper  63, 245-46
  17092.         WIL programs
  17093.           error handling  53-54
  17094.           statement summary  54-63
  17095.           statements  63-278
  17096.           WIL language components  46-51
  17097.         WinActivate  25, 57, 246-47
  17098.         WinArrange  58, 247-48
  17099.         WinClose  26, 58, 248-49
  17100.         WinCloseNot  26, 58, 249-50
  17101.          ________________________________________________________________
  17102.                                                                       291
  17103.  
  17104.  
  17105.                                                                     INDEX
  17106.          ________________________________________________________________
  17107.  
  17108.         WinConfig  64, 250-51
  17109.         Window Management  24
  17110.           in WIL  57-59
  17111.         WinExeName  251-52
  17112.         WinExist  26, 58, 252-53
  17113.         WinGetActive  58, 253-54
  17114.         WinHelp  254-56
  17115.         WinHide  58, 254-57
  17116.         WinIconize  24, 58, 257-58
  17117.         WinItemize  58, 258-59
  17118.         WinMetrics  259-61
  17119.         WinName  261-62
  17120.         WinParmGet  262-64
  17121.         WinParmSet  264-65
  17122.         WinPlace  58, 265-67
  17123.         WinPlaceGet  267-68
  17124.         WinPlaceSet  268-70
  17125.         WinPosition  58, 270-71
  17126.         WinResources  271-72
  17127.         WinShow  24, 58, 272-73
  17128.         WinState  273-74
  17129.         WinTitle  59, 274-75
  17130.         WinVersion  64, 275-76
  17131.         WinWaitClose  26, 59, 276-77
  17132.         WinZoom  24, 59, 277-78
  17133.  
  17134.         Y
  17135.         Yield  63, 278
  17136.  
  17137.  
  17138.  
  17139.  
  17140.  
  17141.  
  17142.  
  17143.  
  17144.  
  17145.  
  17146.  
  17147.  
  17148.  
  17149.  
  17150.  
  17151.  
  17152.  
  17153.  
  17154.  
  17155.  
  17156.  
  17157.          ________________________________________________________________
  17158.                                                                         292
  17159.